Author: jkuhnert
Date: Sat Jan 13 20:41:33 2007
New Revision: 496031

URL: http://svn.apache.org/viewvc?view=rev&rev=496031
Log:
Added ability to do "incremental" compilations on expressions that are intially 
evaluated with null root objects and 
then later evaluated with valid root objects.

Modified:
    
tapestry/tapestry4/branches/ognl-integration/tapestry-examples/TimeTracker/pom.xml
    
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/binding/ExpressionBinding.java
    
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/services/impl/ExpressionCacheImpl.java
    
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java

Modified: 
tapestry/tapestry4/branches/ognl-integration/tapestry-examples/TimeTracker/pom.xml
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/branches/ognl-integration/tapestry-examples/TimeTracker/pom.xml?view=diff&rev=496031&r1=496030&r2=496031
==============================================================================
--- 
tapestry/tapestry4/branches/ognl-integration/tapestry-examples/TimeTracker/pom.xml
 (original)
+++ 
tapestry/tapestry4/branches/ognl-integration/tapestry-examples/TimeTracker/pom.xml
 Sat Jan 13 20:41:33 2007
@@ -111,7 +111,7 @@
                     <systemProperties>
                         <systemProperty>
                             <name>org.apache.tapestry.disable-caching</name>
-                            <value>false</value>
+                            <value>true</value>
                         </systemProperty>
                     </systemProperties>
                 </configuration>

Modified: 
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/binding/ExpressionBinding.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/binding/ExpressionBinding.java?view=diff&rev=496031&r1=496030&r2=496031
==============================================================================
--- 
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/binding/ExpressionBinding.java
 (original)
+++ 
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/binding/ExpressionBinding.java
 Sat Jan 13 20:41:33 2007
@@ -123,7 +123,10 @@
                 _accessor = _parsedExpression.getAccessor();
             }
             
-            return _evaluator.read(_root, _accessor);
+            if (_accessor != null)
+                return _evaluator.read(_root, _accessor);
+            
+            return _evaluator.readCompiled(_root, _parsedExpression);
         }
         catch (Throwable t)
         {

Modified: 
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/services/impl/ExpressionCacheImpl.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/services/impl/ExpressionCacheImpl.java?view=diff&rev=496031&r1=496030&r2=496031
==============================================================================
--- 
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/services/impl/ExpressionCacheImpl.java
 (original)
+++ 
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/services/impl/ExpressionCacheImpl.java
 Sat Jan 13 20:41:33 2007
@@ -86,10 +86,10 @@
             
             Node result = (Node)cached.get(expression);
             
-            if (result == null)
+            if (result == null || result.getAccessor() == null)
             {
-                
                 result = parse(target, expression);
+                
                 cached.put(expression, result);
             }
             

Modified: 
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java?view=diff&rev=496031&r1=496030&r2=496031
==============================================================================
--- 
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java
 (original)
+++ 
tapestry/tapestry4/branches/ognl-integration/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java
 Sat Jan 13 20:41:33 2007
@@ -192,15 +192,17 @@
             
         } catch (UnsupportedCompilationException uc) {
             
-            //System.out.println("Unsupported getter compilation caught: " + 
uc.getMessage());
+            //System.out.println("Unsupported getter compilation caught: " + 
uc.getMessage() + " for expression: " + expression.toString());
             
+            return;
+            /*
             getBody = generateOgnlGetter(classFab, valueGetter);
             
             if (!classFab.containsMethod(expressionSetter)) {
                 
                 classFab.addField("_node", Node.class);
                 classFab.addMethod(Modifier.PUBLIC, expressionSetter, "{ _node 
= $1; }");
-            }
+            }*/
         }
         
         classFab.addMethod(Modifier.PUBLIC, valueGetter, getBody);
@@ -211,7 +213,7 @@
             
         } catch (UnsupportedCompilationException uc) {
             
-            //System.out.println("Unsupported setter compilation caught: " + 
uc.getMessage());
+            //System.out.println("Unsupported setter compilation caught: " + 
uc.getMessage() + " for expression: " + expression.toString());
             
             setBody = generateOgnlSetter(classFab, valueSetter);
             


Reply via email to