commons-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1198666&view=rev
Log:
OGNL-38 - Simplify conditionals.

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

Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/MapPropertyAccessor.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/MapPropertyAccessor.java?rev=1198666&r1=1198665&r2=1198666&view=diff
==============================================================================
--- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/MapPropertyAccessor.java
(original)
+++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/MapPropertyAccessor.java
Mon Nov  7 09:17:15 2011
@@ -62,30 +62,21 @@ public class MapPropertyAccessor
             {
                 result = map.size();
             }
+            else if ( "keys".equals( name ) || "keySet".equals( name ) )
+            {
+                result = map.keySet();
+            }
+            else if ( "values".equals( name ) )
+            {
+                result = map.values();
+            }
+            else if ( "isEmpty".equals( name ) )
+            {
+                result = map.isEmpty() ? Boolean.TRUE : Boolean.FALSE;
+            }
             else
             {
-                if ( "keys".equals( name ) || "keySet".equals( name ) )
-                {
-                    result = map.keySet();
-                }
-                else
-                {
-                    if ( "values".equals( name ) )
-                    {
-                        result = map.values();
-                    }
-                    else
-                    {
-                        if ( "isEmpty".equals( name ) )
-                        {
-                            result = map.isEmpty() ? Boolean.TRUE : Boolean.FALSE;
-                        }
-                        else
-                        {
-                            result = map.get( name );
-                        }
-                    }
-                }
+                result = map.get( name );
             }
         }
         else



Mime
View raw message