test/java/util/Collections/EmptyIterator.java

Print this page

        

*** 21,36 **** * questions. */ /* * @test ! * @bug 5017904 6356890 * @summary Test empty iterators, enumerations, and collections */ - import java.util.*; import static java.util.Collections.*; public class EmptyIterator { void test(String[] args) throws Throwable { testEmptyCollection(Collections.<Object>emptyList()); --- 21,36 ---- * questions. */ /* * @test ! * @bug 5017904 6356890 8004928 * @summary Test empty iterators, enumerations, and collections */ import static java.util.Collections.*; + import java.util.*; public class EmptyIterator { void test(String[] args) throws Throwable { testEmptyCollection(Collections.<Object>emptyList());
*** 43,56 **** testEmptyEnumeration(emptyTable.elements()); testEmptyIterator(emptyTable.keySet().iterator()); testEmptyIterator(emptyTable.values().iterator()); testEmptyIterator(emptyTable.entrySet().iterator()); ! testEmptyEnumeration(javax.swing.tree.DefaultMutableTreeNode ! .EMPTY_ENUMERATION); ! testEmptyEnumeration(javax.swing.text.SimpleAttributeSet ! .EMPTY.getAttributeNames()); @SuppressWarnings("unchecked") Iterator<?> x = new sun.tools.java.MethodSet() .lookupName(sun.tools.java.Identifier.lookup("")); testEmptyIterator(x); --- 43,59 ---- testEmptyEnumeration(emptyTable.elements()); testEmptyIterator(emptyTable.keySet().iterator()); testEmptyIterator(emptyTable.values().iterator()); testEmptyIterator(emptyTable.entrySet().iterator()); ! final Enumeration<EmptyIterator> finalEmptyTyped = ! Collections.emptyEnumeration(); ! testEmptyEnumeration(finalEmptyTyped); ! ! final Enumeration finalEmptyAbstract = ! Collections.emptyEnumeration(); ! testEmptyEnumeration(finalEmptyAbstract); @SuppressWarnings("unchecked") Iterator<?> x = new sun.tools.java.MethodSet() .lookupName(sun.tools.java.Identifier.lookup("")); testEmptyIterator(x);