1. opensymphony
  2. ognl

Commits

jkuh...@d4b077e3-5828-0410-b394-cb2b42183085  committed a10cbfb

Made asttest set propery return type on context when it is known.

  • Participants
  • Parent commits 0d709b2
  • Branches default

Comments (0)

Files changed (2)

File src/java/ognl/ASTTest.java

View file
  • Ignore whitespace
             result += (mismatched ? " ($w) " : "") + third;
 
             context.setCurrentObject(target);
-            context.setCurrentType(Object.class);
+            context.setCurrentType(mismatched ? Object.class : secondType);
 
             return result;
         

File src/java/ognl/enhance/ExpressionCompiler.java

View file
  • Ignore whitespace
      */
     protected ClassPool _pool;
 
+    protected int _classCounter = 0;
+
     /**
      * Default constructor, does nothing.
      */
         EnhancedClassLoader loader = getClassLoader(context);
         ClassPool pool = getClassPool(context, loader);
 
-        CtClass newClass = pool.makeClass(expression.getClass().getName() + expression.hashCode() + "Accessor");
+        CtClass newClass = pool.makeClass(expression.getClass().getName() + expression.hashCode() + _classCounter++ + "Accessor");
         newClass.addInterface(getCtClass(ExpressionAccessor.class));
 
         CtClass ognlClass = getCtClass(OgnlContext.class);