Commits

Anonymous committed bc18488

Fixes OGNL-50. Boolean literals within ASTAnd expressions were failing compilation (stupid ass javassist) unless surrounded with ( ).

  • Participants
  • Parent commits b04d935

Comments (0)

Files changed (3)

File src/java/ognl/ASTAnd.java

             
             result += " ? ";
 
-            result += " ($w) "  + second;
+            result += " ($w) ("  + second + ")";
             result += " : ";
 
-            result += " ($w) " + first;
+            result += " ($w) (" + first + ")";
 
             result += "";
 

File src/test/java/org/ognl/test/PropertyTest.java

             { ROOT, "objectIndex > 0", Boolean.TRUE},
             { ROOT, "false", Boolean.FALSE},
             { ROOT, "!false || true", Boolean.TRUE},
+            { ROOT, "testString != null && !false", Boolean.TRUE},
             { ROOT, "map", ROOT.getMap() },
             { ROOT, "map.test", ROOT },
             { ROOT, "map[\"test\"]", ROOT },

File src/test/java/org/ognl/test/objects/Root.java

     {
         return null;
     }
-    
+
+    public String getTestString()
+    {
+        return "wiggle";
+    }
+
     public Object getProperty()
     {
         return new Bean2();