You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by lu...@apache.org on 2003/03/06 03:09:46 UTC
cvs commit: jakarta-commons/el/src/java/org/apache/commons/el EmptyOperator.java
luehe 2003/03/05 18:09:46
Modified: el/src/java/org/apache/commons/el EmptyOperator.java
Log:
Extended the "empty" operator to all Collection types, not just Map and List
Revision Changes Path
1.2 +7 -7 jakarta-commons/el/src/java/org/apache/commons/el/EmptyOperator.java
Index: EmptyOperator.java
===================================================================
RCS file: /home/cvs/jakarta-commons/el/src/java/org/apache/commons/el/EmptyOperator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EmptyOperator.java 4 Feb 2003 00:22:24 -0000 1.1
+++ EmptyOperator.java 6 Mar 2003 02:09:46 -0000 1.2
@@ -56,7 +56,7 @@
package org.apache.commons.el;
import java.lang.reflect.Array;
-import java.util.List;
+import java.util.Collection;
import java.util.Map;
import javax.servlet.jsp.el.ELException;
@@ -124,15 +124,15 @@
return PrimitiveObjects.getBoolean (true);
}
- // See if the value is an empty List
- else if (pValue instanceof List &&
- ((List) pValue).isEmpty ()) {
- return PrimitiveObjects.getBoolean (true);
- }
-
// See if the value is an empty Map
else if (pValue instanceof Map &&
((Map) pValue).isEmpty ()) {
+ return PrimitiveObjects.getBoolean (true);
+ }
+
+ // See if the value is an empty Collection
+ else if (pValue instanceof Collection &&
+ ((Collection) pValue).isEmpty ()) {
return PrimitiveObjects.getBoolean (true);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org