Improve error message & use i18n
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 21 Jan 2011 12:39:15 +0000 (12:39 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 21 Jan 2011 12:39:15 +0000 (12:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1061787 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/el/Messages.properties
java/org/apache/el/parser/AstDotSuffix.java
java/org/apache/el/parser/AstIdentifier.java
webapps/docs/changelog.xml

index bfd89fa..7fdc6f2 100644 (file)
@@ -48,7 +48,7 @@ error.fnMapper.null=Expression uses functions, but no FunctionMapper was provide
 error.fnMapper.method=Function ''{0}'' not found
 error.fnMapper.paramcount=Function ''{0}'' specifies {1} params, but {2} were declared
 
-# **ExpressionImpl
+# ExpressionImpl
 error.context.null=ELContext was null
 
 # ArrayELResolver
@@ -61,4 +61,7 @@ error.list.outofbounds=Index {0} is out of bounds for list of size {1}
 error.property.notfound=Property ''{1}'' not found on type: {0}
 error.property.invocation=Property ''{1}'' threw an exception from type: {0}
 error.property.notreadable=Property ''{1}'' doesn't have a 'get' specified on type: {0}
-error.property.notwritable=Property ''{1}'' doesn't have a 'set' specified on type: {0}
\ No newline at end of file
+error.property.notwritable=Property ''{1}'' doesn't have a 'set' specified on type: {0}
+
+# Parser
+error.identifier.notjava=The identifier [{0}] is not a valid Java identifier as required by section 1.19 of the EL specification (Identifier ::= Java language identifier). This check can be disabled by setting the system property org.apache.el.parser.SKIP_IDENTIFIER_CHECK to true.
\ No newline at end of file
index 0463b5a..0b0307b 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.el.parser;
 import javax.el.ELException;
 
 import org.apache.el.lang.EvaluationContext;
+import org.apache.el.util.MessageFactory;
 import org.apache.el.util.Validation;
 
 
@@ -42,8 +43,8 @@ public final class AstDotSuffix extends SimpleNode {
     @Override
     public void setImage(String image) {
         if (!Validation.isIdentifier(image)) {
-            throw new ELException("[" + image +
-                    "] is not a valid Java identifier");
+            throw new ELException(MessageFactory.get("error.identifier.notjava",
+                    image));
         }
         this.image = image;
     }
index de7f360..d51e94d 100644 (file)
@@ -129,8 +129,8 @@ public final class AstIdentifier extends SimpleNode {
     @Override
     public void setImage(String image) {
         if (!Validation.isIdentifier(image)) {
-            throw new ELException("[" + image +
-                    "] is not a valid Java identifier");
+            throw new ELException(MessageFactory.get("error.identifier.notjava",
+                    image));
         }
         this.image = image;
     }
index acbabda..204cdbd 100644 (file)
         <bug>15688</bug>: Use fully-qualified class names in generated jsp files
         to avoid naming conflicts with user imports. (markt)
       </update>
+      <update>
+        Improve error message when EL identifiers are not valid Java identifiers
+        and use i18n for the error message. (markt)
+      </update>
     </changelog>
   </subsection>
   <subsection name="Cluster">