You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2007/04/20 15:41:31 UTC

svn commit: r530806 - /tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java

Author: jkuhnert
Date: Fri Apr 20 06:41:30 2007
New Revision: 530806

URL: http://svn.apache.org/viewvc?view=rev&rev=530806
Log:
Added new getRootExpressionClass method for OgnlExpressionCompiler interface impl to handle special corner case of casting previously javassist'ed component classes.

Modified:
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java?view=diff&rev=530806&r1=530805&r2=530806
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java Fri Apr 20 06:41:30 2007
@@ -105,6 +105,19 @@
         return clazz;
     }
 
+    public Class getRootExpressionClass(Node rootNode, OgnlContext context)
+    {
+        if (context.getRoot() == null)
+            return null;
+
+        Class ret = context.getRoot().getClass();
+
+        if (!IRender.class.isInstance(context.getRoot()) && context.getFirstAccessor() != null && context.getFirstAccessor().isInstance(context.getRoot()))
+            ret = context.getFirstAccessor();
+
+        return ret;
+    }
+
     public void compileExpression(OgnlContext context, Node expression, Object root)
             throws Exception
     {