Commits

Anonymous committed 5a37e6b

Fixes regression of string concatenations in OGNL-48.

Comments (0)

Files changed (2)

src/java/ognl/ASTAdd.java

                             && !ASTMethod.class.isInstance(_children[i])
                             && !ASTSequence.class.isInstance(_children[i])
                             && !ASTChain.class.isInstance(_children[i])
-                            && !NumericExpression.class.isAssignableFrom(_children[i].getClass())) {
+                            && !NumericExpression.class.isAssignableFrom(_children[i].getClass())
+                                && !ASTStaticField.class.isInstance(_children[i])
+                                && !ASTStaticMethod.class.isInstance(_children[i])) {
 
                             if (lastType != null && String.class.isAssignableFrom(lastType.getGetterClass()))  {
                                 //System.out.println("Input expr >>" + expr + "<<");

src/test/java/org/ognl/test/NullStringCatenationTest.java

 
 public class NullStringCatenationTest extends OgnlTestCase {
 
+    public static final String MESSAGE = "blarney";
+
     private static Root ROOT = new Root();
 
     private static Object[][] TESTS = {
             {ROOT, "(true ? 'tabHeader' : '') + (false ? 'tabHeader' : '')", "tabHeader"},
             {ROOT, "theInt == 0 ? '5%' : theInt + '%'", "6%"},
             {ROOT, "'width:' + width + ';'", "width:238px;" },
-            {ROOT, "theLong + '_' + index", "4_1"} 
+            {ROOT, "theLong + '_' + index", "4_1"},
+            {ROOT, "'javascript:' + @org.ognl.test.NullStringCatenationTest@MESSAGE", "javascript:blarney" }
     };
 
     /*