Skip to content

Commit

Permalink
Fix PMD warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kohlschuetter committed Aug 28, 2023
1 parent 861daaa commit 3b7df69
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class AFSelector extends AbstractSelector {
private final Set<AFSelectionKey> keysRegistered = ConcurrentHashMap.newKeySet();
private final Set<SelectionKey> keysRegisteredPublic = Collections.unmodifiableSet(
keysRegistered);
private AtomicInteger numKeysSelected = new AtomicInteger();
private final AtomicInteger numKeysSelected = new AtomicInteger();
private final SelectionKeySet keysSelectedPublic = new SelectionKeySet();

private PollFd pollFd = null;
Expand Down Expand Up @@ -374,12 +374,12 @@ public Iterator<SelectionKey> iterator() {
}
Iterator<AFSelectionKey> it = keysRegistered.iterator();
return new Iterator<SelectionKey>() {
AFSelectionKey current = null;
AFSelectionKey next = next0();
AFSelectionKey currentKey = null;
AFSelectionKey nextKey = next0();

@Override
public boolean hasNext() {
return next != null;
return nextKey != null;
}

private AFSelectionKey next0() {
Expand All @@ -394,19 +394,19 @@ private AFSelectionKey next0() {

@Override
public SelectionKey next() {
if (next == null) {
if (nextKey == null) {
throw new NoSuchElementException();
}
current = next;
next = next0();
return current;
currentKey = nextKey;
nextKey = next0();
return currentKey;
}

@Override
public void remove() {
if (current != null) {
SelectionKeySet.this.remove(current);
current = null;
if (currentKey != null) {
SelectionKeySet.this.remove(currentKey);
currentKey = null;
}
}
};
Expand Down

0 comments on commit 3b7df69

Please sign in to comment.