You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/01/16 13:57:56 UTC

svn commit: r899935 - in /tomcat/trunk/java/org/apache/el/parser: AstIdentifier.java AstValue.java

Author: markt
Date: Sat Jan 16 12:57:55 2010
New Revision: 899935

URL: http://svn.apache.org/viewvc?rev=899935&view=rev
Log:
TCK failure: Must check to see if property is resolved and throw exception if not.

Modified:
    tomcat/trunk/java/org/apache/el/parser/AstIdentifier.java
    tomcat/trunk/java/org/apache/el/parser/AstValue.java

Modified: tomcat/trunk/java/org/apache/el/parser/AstIdentifier.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/parser/AstIdentifier.java?rev=899935&r1=899934&r2=899935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/parser/AstIdentifier.java (original)
+++ tomcat/trunk/java/org/apache/el/parser/AstIdentifier.java Sat Jan 16 12:57:55 2010
@@ -22,10 +22,12 @@
 import javax.el.MethodExpression;
 import javax.el.MethodInfo;
 import javax.el.MethodNotFoundException;
+import javax.el.PropertyNotFoundException;
 import javax.el.ValueExpression;
 import javax.el.VariableMapper;
 
 import org.apache.el.lang.EvaluationContext;
+import org.apache.el.util.MessageFactory;
 
 
 /**
@@ -47,7 +49,12 @@
             }
         }
         ctx.setPropertyResolved(false);
-        return ctx.getELResolver().getType(ctx, null, this.image);
+        Class<?> result = ctx.getELResolver().getType(ctx, null, this.image);
+        if (!ctx.isPropertyResolved()) {
+            throw new PropertyNotFoundException(MessageFactory.get(
+                    "error.resolver.unhandled.null", this.image));
+        }
+        return result;
     }
 
     @Override
@@ -60,7 +67,12 @@
             }
         }
         ctx.setPropertyResolved(false);
-        return ctx.getELResolver().getValue(ctx, null, this.image);
+        Object result = ctx.getELResolver().getValue(ctx, null, this.image);
+        if (!ctx.isPropertyResolved()) {
+            throw new PropertyNotFoundException(MessageFactory.get(
+                    "error.resolver.unhandled.null", this.image));
+        }
+        return result;
     }
 
     @Override
@@ -73,7 +85,12 @@
             }
         }
         ctx.setPropertyResolved(false);
-        return ctx.getELResolver().isReadOnly(ctx, null, this.image);
+        boolean result = ctx.getELResolver().isReadOnly(ctx, null, this.image);
+        if (!ctx.isPropertyResolved()) {
+            throw new PropertyNotFoundException(MessageFactory.get(
+                    "error.resolver.unhandled.null", this.image));
+        }
+        return result;
     }
 
     @Override
@@ -89,6 +106,10 @@
         }
         ctx.setPropertyResolved(false);
         ctx.getELResolver().setValue(ctx, null, this.image, value);
+        if (!ctx.isPropertyResolved()) {
+            throw new PropertyNotFoundException(MessageFactory.get(
+                    "error.resolver.unhandled.null", this.image));
+        }
     }
 
     @Override

Modified: tomcat/trunk/java/org/apache/el/parser/AstValue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/parser/AstValue.java?rev=899935&r1=899934&r2=899935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/parser/AstValue.java (original)
+++ tomcat/trunk/java/org/apache/el/parser/AstValue.java Sat Jan 16 12:57:55 2010
@@ -57,7 +57,12 @@
     public Class<?> getType(EvaluationContext ctx) throws ELException {
         Target t = getTarget(ctx);
         ctx.setPropertyResolved(false);
-        return ctx.getELResolver().getType(ctx, t.base, t.property);
+        Class<?> result = ctx.getELResolver().getType(ctx, t.base, t.property);
+        if (!ctx.isPropertyResolved()) {
+            throw new PropertyNotFoundException(MessageFactory.get(
+                    "error.resolver.unhandled", t.base, t.property));            
+        }
+        return result;
     }
 
     private final Target getTarget(EvaluationContext ctx) throws ELException {
@@ -141,6 +146,10 @@
                 i++;
             }
         }
+        if (!ctx.isPropertyResolved()) {
+            throw new PropertyNotFoundException(MessageFactory.get(
+                    "error.resolver.unhandled", base, suffix));            
+        }
         return base;
     }
 
@@ -148,7 +157,13 @@
     public boolean isReadOnly(EvaluationContext ctx) throws ELException {
         Target t = getTarget(ctx);
         ctx.setPropertyResolved(false);
-        return ctx.getELResolver().isReadOnly(ctx, t.base, t.property);
+        boolean result =
+            ctx.getELResolver().isReadOnly(ctx, t.base, t.property);
+        if (!ctx.isPropertyResolved()) {
+            throw new PropertyNotFoundException(MessageFactory.get(
+                    "error.resolver.unhandled", t.base, t.property));            
+        }
+        return result;
     }
 
     @Override
@@ -167,6 +182,10 @@
         } else {
             resolver.setValue(ctx, t.base, t.property, value);
         }
+        if (!ctx.isPropertyResolved()) {
+            throw new PropertyNotFoundException(MessageFactory.get(
+                    "error.resolver.unhandled", t.base, t.property));            
+        }
     }
 
     private boolean isAssignable(Object value, Class<?> targetClass) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org