Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8297682: Use Collections.emptyIterator where applicable
Reviewed-by: stsypanov, alanb, jpai
  • Loading branch information
Andrey Turbanov committed Dec 21, 2022
1 parent f36e144 commit 85f9b37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java
Expand Up @@ -189,8 +189,7 @@ public Iterator<Path> iterator() {
sm.checkRead(rootDirectory.toString());
return allowedList.iterator();
} catch (SecurityException x) {
List<Path> disallowed = Collections.emptyList();
return disallowed.iterator();
return Collections.emptyIterator(); //disallowed
}
}
};
Expand Down
Expand Up @@ -383,8 +383,7 @@ private Iterator<Processor> handleServiceLoaderUnavailability(String key, Except
handleException(key, e);
}

java.util.List<Processor> pl = Collections.emptyList();
return pl.iterator();
return Collections.emptyIterator();
}

/**
Expand Down

1 comment on commit 85f9b37

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.