dgraham 2003/07/04 14:44:55
Modified: src/share/org/apache/struts/tiles ComponentContext.java
Log:
Replaced EmptyIterator with standard Collections.EMPTY_LIST.iterator().
Revision Changes Path
1.5 +5 -24
jakarta-struts/src/share/org/apache/struts/tiles/ComponentContext.java
Index: ComponentContext.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/ComponentContext.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ComponentContext.java 4 Jul 2003 21:41:18 -0000 1.4
+++ ComponentContext.java 4 Jul 2003 21:44:55 -0000 1.5
@@ -62,6 +62,7 @@
package org.apache.struts.tiles;
import java.io.Serializable;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -83,11 +84,6 @@
private Map attributes=null;
/**
- * EmptyIterator over component attributes.
- */
- private static Iterator EMPTY_ITERATOR = new EmptyIterator();
-
- /**
* Constructor.
*/
public ComponentContext() {
@@ -167,7 +163,7 @@
*/
public Iterator getAttributeNames() {
if (attributes == null) {
- return EMPTY_ITERATOR;
+ return Collections.EMPTY_LIST.iterator();
}
return attributes.keySet().iterator();
@@ -244,18 +240,3 @@
request.setAttribute(ComponentConstants.COMPONENT_CONTEXT, context);
}
}
-
-class EmptyIterator implements Iterator {
-
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- throw new java.util.NoSuchElementException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-} // end inner class
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]