From 0da32293b57148fc7516f139450a3b18105681ff Mon Sep 17 00:00:00 2001 From: Henry Jen Date: Fri, 21 Feb 2014 15:28:39 -0800 Subject: [PATCH] 8035487: Fix raw and unchecked lint warnings in javax.imageio.spi Reviewed-by: darcy, prr --- .../classes/javax/imageio/ImageReader.java | 2 +- .../classes/javax/imageio/ImageWriter.java | 2 +- .../javax/imageio/spi/DigraphNode.java | 30 +++---- .../javax/imageio/spi/IIORegistry.java | 16 ++-- .../javax/imageio/spi/ImageReaderSpi.java | 12 +-- .../imageio/spi/ImageReaderWriterSpi.java | 2 +- .../javax/imageio/spi/ImageWriterSpi.java | 12 +-- .../imageio/spi/PartiallyOrderedSet.java | 60 +++++++------- .../javax/imageio/spi/ServiceRegistry.java | 79 ++++++++++--------- 9 files changed, 109 insertions(+), 106 deletions(-) diff --git a/jdk/src/share/classes/javax/imageio/ImageReader.java b/jdk/src/share/classes/javax/imageio/ImageReader.java index 361ba446571..1ff7c219e2d 100644 --- a/jdk/src/share/classes/javax/imageio/ImageReader.java +++ b/jdk/src/share/classes/javax/imageio/ImageReader.java @@ -291,7 +291,7 @@ public abstract class ImageReader { if (input != null) { boolean found = false; if (originatingProvider != null) { - Class[] classes = originatingProvider.getInputTypes(); + Class[] classes = originatingProvider.getInputTypes(); for (int i = 0; i < classes.length; i++) { if (classes[i].isInstance(input)) { found = true; diff --git a/jdk/src/share/classes/javax/imageio/ImageWriter.java b/jdk/src/share/classes/javax/imageio/ImageWriter.java index b834b85742a..43f48e7c62d 100644 --- a/jdk/src/share/classes/javax/imageio/ImageWriter.java +++ b/jdk/src/share/classes/javax/imageio/ImageWriter.java @@ -205,7 +205,7 @@ public abstract class ImageWriter implements ImageTranscoder { if (output != null) { ImageWriterSpi provider = getOriginatingProvider(); if (provider != null) { - Class[] classes = provider.getOutputTypes(); + Class[] classes = provider.getOutputTypes(); boolean found = false; for (int i = 0; i < classes.length; i++) { if (classes[i].isInstance(output)) { diff --git a/jdk/src/share/classes/javax/imageio/spi/DigraphNode.java b/jdk/src/share/classes/javax/imageio/spi/DigraphNode.java index b133c29db9a..7fb4c625853 100644 --- a/jdk/src/share/classes/javax/imageio/spi/DigraphNode.java +++ b/jdk/src/share/classes/javax/imageio/spi/DigraphNode.java @@ -39,17 +39,17 @@ import java.util.Set; * the current node) may be queried. * */ -class DigraphNode implements Cloneable, Serializable { +class DigraphNode implements Cloneable, Serializable { private static final long serialVersionUID = 5308261378582246841L; /** The data associated with this node. */ - protected Object data; + protected E data; /** * A Set of neighboring nodes pointed to by this * node. */ - protected Set outNodes = new HashSet(); + protected Set> outNodes = new HashSet<>(); /** The in-degree of the node. */ protected int inDegree = 0; @@ -58,14 +58,14 @@ class DigraphNode implements Cloneable, Serializable { * A Set of neighboring nodes that point to this * node. */ - private Set inNodes = new HashSet(); + private Set> inNodes = new HashSet<>(); - public DigraphNode(Object data) { + public DigraphNode(E data) { this.data = data; } /** Returns the Object referenced by this node. */ - public Object getData() { + public E getData() { return data; } @@ -73,7 +73,7 @@ class DigraphNode implements Cloneable, Serializable { * Returns an Iterator containing the nodes pointed * to by this node. */ - public Iterator getOutNodes() { + public Iterator> getOutNodes() { return outNodes.iterator(); } @@ -86,7 +86,7 @@ class DigraphNode implements Cloneable, Serializable { * @return true if the node was not previously the * target of an edge. */ - public boolean addEdge(DigraphNode node) { + public boolean addEdge(DigraphNode node) { if (outNodes.contains(node)) { return false; } @@ -105,7 +105,7 @@ class DigraphNode implements Cloneable, Serializable { * * @return true if the node is the target of an edge. */ - public boolean hasEdge(DigraphNode node) { + public boolean hasEdge(DigraphNode node) { return outNodes.contains(node); } @@ -116,7 +116,7 @@ class DigraphNode implements Cloneable, Serializable { * @return true if the node was previously the target * of an edge. */ - public boolean removeEdge(DigraphNode node) { + public boolean removeEdge(DigraphNode node) { if (!outNodes.contains(node)) { return false; } @@ -132,15 +132,17 @@ class DigraphNode implements Cloneable, Serializable { * appropriately. */ public void dispose() { - Object[] inNodesArray = inNodes.toArray(); + @SuppressWarnings("unchecked") + DigraphNode[] inNodesArray = (DigraphNode[])inNodes.toArray(); for(int i=0; i node = inNodesArray[i]; node.removeEdge(this); } - Object[] outNodesArray = outNodes.toArray(); + @SuppressWarnings("unchecked") + DigraphNode[] outNodesArray = (DigraphNode[])outNodes.toArray(); for(int i=0; i node = outNodesArray[i]; removeEdge(node); } } diff --git a/jdk/src/share/classes/javax/imageio/spi/IIORegistry.java b/jdk/src/share/classes/javax/imageio/spi/IIORegistry.java index 36deb519909..fe4704428e5 100644 --- a/jdk/src/share/classes/javax/imageio/spi/IIORegistry.java +++ b/jdk/src/share/classes/javax/imageio/spi/IIORegistry.java @@ -115,7 +115,7 @@ public final class IIORegistry extends ServiceRegistry { * A Vector containing the valid IIO registry * categories (superinterfaces) to be used in the constructor. */ - private static final Vector initialCategories = new Vector(5); + private static final Vector> initialCategories = new Vector<>(5); static { initialCategories.add(ImageReaderSpi.class); @@ -198,9 +198,10 @@ public final class IIORegistry extends ServiceRegistry { ClassLoader loader = Thread.currentThread().getContextClassLoader(); - Iterator categories = getCategories(); + Iterator> categories = getCategories(); while (categories.hasNext()) { - Class c = (Class)categories.next(); + @SuppressWarnings("unchecked") + Class c = (Class)categories.next(); Iterator riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { @@ -234,12 +235,13 @@ public final class IIORegistry extends ServiceRegistry { file read capability is restricted (like the applet context case). */ - PrivilegedAction doRegistration = - new PrivilegedAction() { + PrivilegedAction doRegistration = + new PrivilegedAction() { public Object run() { - Iterator categories = getCategories(); + Iterator> categories = getCategories(); while (categories.hasNext()) { - Class c = (Class)categories.next(); + @SuppressWarnings("unchecked") + Class c = (Class)categories.next(); for (IIOServiceProvider p : ServiceLoader.loadInstalled(c)) { registerServiceProvider(p); } diff --git a/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java b/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java index 9ce6de36c66..01a2bc8c539 100644 --- a/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java +++ b/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java @@ -81,14 +81,14 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi { * the equivalent array { ImageInputStream.class }. */ @Deprecated - public static final Class[] STANDARD_INPUT_TYPE = + public static final Class[] STANDARD_INPUT_TYPE = { ImageInputStream.class }; /** * An array of Class objects to be returned from * getInputTypes, initially null. */ - protected Class[] inputTypes = null; + protected Class[] inputTypes = null; /** * An array of strings to be returned from @@ -101,7 +101,7 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi { * The Class of the reader, initially * null. */ - private Class readerClass = null; + private Class readerClass = null; /** * Constructs a blank ImageReaderSpi. It is up to @@ -197,7 +197,7 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi { String[] suffixes, String[] MIMETypes, String readerClassName, - Class[] inputTypes, + Class[] inputTypes, String[] writerSpiNames, boolean supportsStandardStreamMetadataFormat, String nativeStreamMetadataFormatName, @@ -252,9 +252,9 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi { * returned. * * @return a non-null array of - * Classobjects of length at least 1. + * Class objects of length at least 1. */ - public Class[] getInputTypes() { + public Class[] getInputTypes() { return inputTypes.clone(); } diff --git a/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java b/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java index 4a5dd1416f4..2918d99e93a 100644 --- a/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java +++ b/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java @@ -587,7 +587,7 @@ public abstract class ImageReaderWriterSpi extends IIOServiceProvider { throw new IllegalArgumentException("Unsupported format name"); } try { - Class cls = Class.forName(formatClassName, true, + Class cls = Class.forName(formatClassName, true, ClassLoader.getSystemClassLoader()); Method meth = cls.getMethod("getInstance"); return (IIOMetadataFormat) meth.invoke(null); diff --git a/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java b/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java index 19d17145452..6e78e39cd9e 100644 --- a/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java +++ b/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java @@ -83,14 +83,14 @@ public abstract class ImageWriterSpi extends ImageReaderWriterSpi { * the equivalent array { ImageOutputStream.class }. */ @Deprecated - public static final Class[] STANDARD_OUTPUT_TYPE = + public static final Class[] STANDARD_OUTPUT_TYPE = { ImageOutputStream.class }; /** * An array of Class objects to be returned from * getOutputTypes, initially null. */ - protected Class[] outputTypes = null; + protected Class[] outputTypes = null; /** * An array of strings to be returned from @@ -103,7 +103,7 @@ public abstract class ImageWriterSpi extends ImageReaderWriterSpi { * The Class of the writer, initially * null. */ - private Class writerClass = null; + private Class writerClass = null; /** * Constructs a blank ImageWriterSpi. It is up to @@ -198,7 +198,7 @@ public abstract class ImageWriterSpi extends ImageReaderWriterSpi { String[] suffixes, String[] MIMETypes, String writerClassName, - Class[] outputTypes, + Class[] outputTypes, String[] readerSpiNames, boolean supportsStandardStreamMetadataFormat, String nativeStreamMetadataFormatName, @@ -265,9 +265,9 @@ public abstract class ImageWriterSpi extends ImageReaderWriterSpi { * returned. * * @return a non-null array of - * Classobjects of length at least 1. + * Class objects of length at least 1. */ - public Class[] getOutputTypes() { + public Class[] getOutputTypes() { return outputTypes.clone(); } diff --git a/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java index 99dbf591eb7..f4d17c2b427 100644 --- a/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java +++ b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java @@ -51,17 +51,17 @@ import java.util.Set; * supplied by a trusted vendor over those supplied by another. * */ -class PartiallyOrderedSet extends AbstractSet { +class PartiallyOrderedSet extends AbstractSet { // The topological sort (roughly) follows the algorithm described in // Horowitz and Sahni, _Fundamentals of Data Structures_ (1976), // p. 315. // Maps Objects to DigraphNodes that contain them - private Map poNodes = new HashMap(); + private Map> poNodes = new HashMap<>(); // The set of Objects - private Set nodes = poNodes.keySet(); + private Set nodes = poNodes.keySet(); /** * Constructs a PartiallyOrderedSet. @@ -81,20 +81,20 @@ class PartiallyOrderedSet extends AbstractSet { * collection, with an ordering that respects the orderings set * by the setOrdering method. */ - public Iterator iterator() { - return new PartialOrderIterator(poNodes.values().iterator()); + public Iterator iterator() { + return new PartialOrderIterator<>(poNodes.values().iterator()); } /** * Adds an Object to this * PartiallyOrderedSet. */ - public boolean add(Object o) { + public boolean add(E o) { if (nodes.contains(o)) { return false; } - DigraphNode node = new DigraphNode(o); + DigraphNode node = new DigraphNode<>(o); poNodes.put(o, node); return true; } @@ -104,7 +104,7 @@ class PartiallyOrderedSet extends AbstractSet { * PartiallyOrderedSet. */ public boolean remove(Object o) { - DigraphNode node = (DigraphNode)poNodes.get(o); + DigraphNode node = poNodes.get(o); if (node == null) { return false; } @@ -127,11 +127,9 @@ class PartiallyOrderedSet extends AbstractSet { * @return true if no prior ordering existed * between the nodes, falseotherwise. */ - public boolean setOrdering(Object first, Object second) { - DigraphNode firstPONode = - (DigraphNode)poNodes.get(first); - DigraphNode secondPONode = - (DigraphNode)poNodes.get(second); + public boolean setOrdering(E first, E second) { + DigraphNode firstPONode = poNodes.get(first); + DigraphNode secondPONode = poNodes.get(second); secondPONode.removeEdge(firstPONode); return firstPONode.addEdge(secondPONode); @@ -142,11 +140,9 @@ class PartiallyOrderedSet extends AbstractSet { * * @return true if a prior prefence existed between the nodes. */ - public boolean unsetOrdering(Object first, Object second) { - DigraphNode firstPONode = - (DigraphNode)poNodes.get(first); - DigraphNode secondPONode = - (DigraphNode)poNodes.get(second); + public boolean unsetOrdering(E first, E second) { + DigraphNode firstPONode = poNodes.get(first); + DigraphNode secondPONode = poNodes.get(second); return firstPONode.removeEdge(secondPONode) || secondPONode.removeEdge(firstPONode); @@ -156,25 +152,23 @@ class PartiallyOrderedSet extends AbstractSet { * Returns true if an ordering exists between two * nodes. */ - public boolean hasOrdering(Object preferred, Object other) { - DigraphNode preferredPONode = - (DigraphNode)poNodes.get(preferred); - DigraphNode otherPONode = - (DigraphNode)poNodes.get(other); + public boolean hasOrdering(E preferred, E other) { + DigraphNode preferredPONode = poNodes.get(preferred); + DigraphNode otherPONode = poNodes.get(other); return preferredPONode.hasEdge(otherPONode); } } -class PartialOrderIterator implements Iterator { +class PartialOrderIterator implements Iterator { - LinkedList zeroList = new LinkedList(); - Map inDegrees = new HashMap(); // DigraphNode -> Integer + LinkedList> zeroList = new LinkedList<>(); + Map, Integer> inDegrees = new HashMap<>(); - public PartialOrderIterator(Iterator iter) { + public PartialOrderIterator(Iterator> iter) { // Initialize scratch in-degree values, zero list while (iter.hasNext()) { - DigraphNode node = (DigraphNode)iter.next(); + DigraphNode node = iter.next(); int inDegree = node.getInDegree(); inDegrees.put(node, new Integer(inDegree)); @@ -189,14 +183,14 @@ class PartialOrderIterator implements Iterator { return !zeroList.isEmpty(); } - public Object next() { - DigraphNode first = (DigraphNode)zeroList.removeFirst(); + public E next() { + DigraphNode first = zeroList.removeFirst(); // For each out node of the output node, decrement its in-degree - Iterator outNodes = first.getOutNodes(); + Iterator> outNodes = first.getOutNodes(); while (outNodes.hasNext()) { - DigraphNode node = (DigraphNode)outNodes.next(); - int inDegree = ((Integer)inDegrees.get(node)).intValue() - 1; + DigraphNode node = outNodes.next(); + int inDegree = inDegrees.get(node).intValue() - 1; inDegrees.put(node, new Integer(inDegree)); // If the in-degree has fallen to 0, place the node on the list diff --git a/jdk/src/share/classes/javax/imageio/spi/ServiceRegistry.java b/jdk/src/share/classes/javax/imageio/spi/ServiceRegistry.java index a3fc54816a2..aed9630c6da 100644 --- a/jdk/src/share/classes/javax/imageio/spi/ServiceRegistry.java +++ b/jdk/src/share/classes/javax/imageio/spi/ServiceRegistry.java @@ -99,7 +99,7 @@ import java.util.ServiceLoader; public class ServiceRegistry { // Class -> Registry - private Map categoryMap = new HashMap(); + private Map, SubRegistry> categoryMap = new HashMap<>(); /** * Constructs a ServiceRegistry instance with a @@ -117,7 +117,7 @@ public class ServiceRegistry { throw new IllegalArgumentException("categories == null!"); } while (categories.hasNext()) { - Class category = (Class)categories.next(); + Class category = categories.next(); SubRegistry reg = new SubRegistry(this, category); categoryMap.put(category, reg); } @@ -208,7 +208,7 @@ public class ServiceRegistry { * Classobjects. */ public Iterator> getCategories() { - Set keySet = categoryMap.keySet(); + Set> keySet = categoryMap.keySet(); return keySet.iterator(); } @@ -216,13 +216,13 @@ public class ServiceRegistry { * Returns an Iterator containing the subregistries to which the * provider belongs. */ - private Iterator getSubRegistries(Object provider) { - List l = new ArrayList(); - Iterator iter = categoryMap.keySet().iterator(); + private Iterator getSubRegistries(Object provider) { + List l = new ArrayList<>(); + Iterator> iter = categoryMap.keySet().iterator(); while (iter.hasNext()) { - Class c = (Class)iter.next(); + Class c = iter.next(); if (c.isAssignableFrom(provider.getClass())) { - l.add((SubRegistry)categoryMap.get(c)); + l.add(categoryMap.get(c)); } } return l.iterator(); @@ -259,7 +259,7 @@ public class ServiceRegistry { if (provider == null) { throw new IllegalArgumentException("provider == null!"); } - SubRegistry reg = (SubRegistry)categoryMap.get(category); + SubRegistry reg = categoryMap.get(category); if (reg == null) { throw new IllegalArgumentException("category unknown!"); } @@ -292,9 +292,9 @@ public class ServiceRegistry { if (provider == null) { throw new IllegalArgumentException("provider == null!"); } - Iterator regs = getSubRegistries(provider); + Iterator regs = getSubRegistries(provider); while (regs.hasNext()) { - SubRegistry reg = (SubRegistry)regs.next(); + SubRegistry reg = regs.next(); reg.registerServiceProvider(provider); } } @@ -362,7 +362,7 @@ public class ServiceRegistry { if (provider == null) { throw new IllegalArgumentException("provider == null!"); } - SubRegistry reg = (SubRegistry)categoryMap.get(category); + SubRegistry reg = categoryMap.get(category); if (reg == null) { throw new IllegalArgumentException("category unknown!"); } @@ -385,9 +385,9 @@ public class ServiceRegistry { if (provider == null) { throw new IllegalArgumentException("provider == null!"); } - Iterator regs = getSubRegistries(provider); + Iterator regs = getSubRegistries(provider); while (regs.hasNext()) { - SubRegistry reg = (SubRegistry)regs.next(); + SubRegistry reg = regs.next(); reg.deregisterServiceProvider(provider); } } @@ -408,9 +408,9 @@ public class ServiceRegistry { if (provider == null) { throw new IllegalArgumentException("provider == null!"); } - Iterator regs = getSubRegistries(provider); + Iterator regs = getSubRegistries(provider); while (regs.hasNext()) { - SubRegistry reg = (SubRegistry)regs.next(); + SubRegistry reg = regs.next(); if (reg.contains(provider)) { return true; } @@ -442,11 +442,13 @@ public class ServiceRegistry { */ public Iterator getServiceProviders(Class category, boolean useOrdering) { - SubRegistry reg = (SubRegistry)categoryMap.get(category); + SubRegistry reg = categoryMap.get(category); if (reg == null) { throw new IllegalArgumentException("category unknown!"); } - return reg.getServiceProviders(useOrdering); + @SuppressWarnings("unchecked") + Iterator it = (Iterator)reg.getServiceProviders(useOrdering); + return it; } /** @@ -499,12 +501,12 @@ public class ServiceRegistry { public Iterator getServiceProviders(Class category, Filter filter, boolean useOrdering) { - SubRegistry reg = (SubRegistry)categoryMap.get(category); + SubRegistry reg = categoryMap.get(category); if (reg == null) { throw new IllegalArgumentException("category unknown!"); } - Iterator iter = getServiceProviders(category, useOrdering); - return new FilterIterator(iter, filter); + Iterator iter = getServiceProviders(category, useOrdering); + return new FilterIterator<>(iter, filter); } /** @@ -529,11 +531,11 @@ public class ServiceRegistry { if (providerClass == null) { throw new IllegalArgumentException("providerClass == null!"); } - Iterator iter = categoryMap.keySet().iterator(); + Iterator> iter = categoryMap.keySet().iterator(); while (iter.hasNext()) { - Class c = (Class)iter.next(); + Class c = iter.next(); if (c.isAssignableFrom(providerClass)) { - SubRegistry reg = (SubRegistry)categoryMap.get(c); + SubRegistry reg = categoryMap.get(c); T provider = reg.getServiceProviderByClass(providerClass); if (provider != null) { return provider; @@ -580,7 +582,7 @@ public class ServiceRegistry { if (firstProvider == secondProvider) { throw new IllegalArgumentException("providers are the same!"); } - SubRegistry reg = (SubRegistry)categoryMap.get(category); + SubRegistry reg = categoryMap.get(category); if (reg == null) { throw new IllegalArgumentException("category unknown!"); } @@ -626,7 +628,7 @@ public class ServiceRegistry { if (firstProvider == secondProvider) { throw new IllegalArgumentException("providers are the same!"); } - SubRegistry reg = (SubRegistry)categoryMap.get(category); + SubRegistry reg = categoryMap.get(category); if (reg == null) { throw new IllegalArgumentException("category unknown!"); } @@ -647,7 +649,7 @@ public class ServiceRegistry { * corresponding to category. */ public void deregisterAll(Class category) { - SubRegistry reg = (SubRegistry)categoryMap.get(category); + SubRegistry reg = categoryMap.get(category); if (reg == null) { throw new IllegalArgumentException("category unknown!"); } @@ -659,9 +661,9 @@ public class ServiceRegistry { * categories. */ public void deregisterAll() { - Iterator iter = categoryMap.values().iterator(); + Iterator iter = categoryMap.values().iterator(); while (iter.hasNext()) { - SubRegistry reg = (SubRegistry)iter.next(); + SubRegistry reg = iter.next(); reg.clear(); } } @@ -690,15 +692,17 @@ class SubRegistry { ServiceRegistry registry; - Class category; + Class category; // Provider Objects organized by partial oridering - PartiallyOrderedSet poset = new PartiallyOrderedSet(); + PartiallyOrderedSet poset = new PartiallyOrderedSet<>(); // Class -> Provider Object of that class - Map,Object> map = new HashMap(); + // No way to express heterogeneous map, we want + // Map, T>, where T is ? + Map, Object> map = new HashMap<>(); - public SubRegistry(ServiceRegistry registry, Class category) { + public SubRegistry(ServiceRegistry registry, Class category) { this.registry = registry; this.category = category; } @@ -756,7 +760,7 @@ class SubRegistry { return poset.unsetOrdering(firstProvider, secondProvider); } - public Iterator getServiceProviders(boolean useOrdering) { + public Iterator getServiceProviders(boolean useOrdering) { if (useOrdering) { return poset.iterator(); } else { @@ -764,12 +768,13 @@ class SubRegistry { } } + @SuppressWarnings("unchecked") public T getServiceProviderByClass(Class providerClass) { return (T)map.get(providerClass); } public void clear() { - Iterator iter = map.values().iterator(); + Iterator iter = map.values().iterator(); while (iter.hasNext()) { Object provider = iter.next(); iter.remove(); @@ -794,12 +799,12 @@ class SubRegistry { */ class FilterIterator implements Iterator { - private Iterator iter; + private Iterator iter; private ServiceRegistry.Filter filter; private T next = null; - public FilterIterator(Iterator iter, + public FilterIterator(Iterator iter, ServiceRegistry.Filter filter) { this.iter = iter; this.filter = filter;