This is an automated email from the ASF dual-hosted git repository. mbenson pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ant.git
commit ccde92427d0ab35af64d618e2492d521af1c26e1 Author: Matt Benson <mben...@apache.org> AuthorDate: Wed Feb 9 11:51:13 2022 -0600 use Collections#emptyIterator --- .../org/apache/tools/ant/types/resources/Resources.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/main/org/apache/tools/ant/types/resources/Resources.java b/src/main/org/apache/tools/ant/types/resources/Resources.java index 15ea73d..cf6bc03 100644 --- a/src/main/org/apache/tools/ant/types/resources/Resources.java +++ b/src/main/org/apache/tools/ant/types/resources/Resources.java @@ -58,20 +58,7 @@ public class Resources extends DataType implements AppendableResourceCollection }; /** {@code static} empty {@link Iterator} */ - public static final Iterator<Resource> EMPTY_ITERATOR = new Iterator<Resource>() { - @Override - public Resource next() { - throw new NoSuchElementException(); - } - @Override - public boolean hasNext() { - return false; - } - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - }; + public static final Iterator<Resource> EMPTY_ITERATOR = Collections.emptyIterator(); private class MyCollection extends AbstractCollection<Resource> { private Collection<Resource> cached;