commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcucchi...@apache.org
Subject svn commit: r1198679 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/SetPropertyAccessor.java
Date Mon, 07 Nov 2011 09:46:10 GMT
Author: mcucchiara
Date: Mon Nov  7 09:46:09 2011
New Revision: 1198679

URL: http://svn.apache.org/viewvc?rev=1198679&view=rev
Log:
OGNL-38 - Test CONSTANT.equals(variable) and simplify conditionals.

Modified:
    commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/SetPropertyAccessor.java

Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/SetPropertyAccessor.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/SetPropertyAccessor.java?rev=1198679&r1=1198678&r2=1198679&view=diff
==============================================================================
--- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/SetPropertyAccessor.java
(original)
+++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/SetPropertyAccessor.java
Mon Nov  7 09:46:09 2011
@@ -43,27 +43,21 @@ public class SetPropertyAccessor
         {
             Object result;
 
-            if ( name.equals( "size" ) )
+            if ( "size".equals( name ) )
             {
-                result = Integer.valueOf( set.size() );
+                result = set.size();
+            }
+            else if ( "iterator".equals( name ) )
+            {
+                result = set.iterator();
+            }
+            else if ( "isEmpty".equals( name ) )
+            {
+                result = set.isEmpty() ? Boolean.TRUE : Boolean.FALSE;
             }
             else
             {
-                if ( name.equals( "iterator" ) )
-                {
-                    result = set.iterator();
-                }
-                else
-                {
-                    if ( name.equals( "isEmpty" ) )
-                    {
-                        result = set.isEmpty() ? Boolean.TRUE : Boolean.FALSE;
-                    }
-                    else
-                    {
-                        result = super.getProperty( context, target, name );
-                    }
-                }
+                result = super.getProperty( context, target, name );
             }
             return result;
         }



Mime
View raw message