Author: markt
Date: Fri Jan 21 12:39:15 2011
New Revision: 1061787
URL: http://svn.apache.org/viewvc?rev=1061787&view=rev
Log:
Improve error message & use i18n
Modified:
tomcat/trunk/java/org/apache/el/Messages.properties
tomcat/trunk/java/org/apache/el/parser/AstDotSuffix.java
tomcat/trunk/java/org/apache/el/parser/AstIdentifier.java
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/java/org/apache/el/Messages.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/Messages.properties?rev=1061787&r1=1061786&r2=1061787&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/Messages.properties (original)
+++ tomcat/trunk/java/org/apache/el/Messages.properties Fri Jan 21 12:39:15 2011
@@ -48,7 +48,7 @@ error.fnMapper.null=Expression uses func
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
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
Modified: tomcat/trunk/java/org/apache/el/parser/AstDotSuffix.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/parser/AstDotSuffix.java?rev=1061787&r1=1061786&r2=1061787&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/parser/AstDotSuffix.java (original)
+++ tomcat/trunk/java/org/apache/el/parser/AstDotSuffix.java Fri Jan 21
12:39:15 2011
@@ -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
@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;
}
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=1061787&r1=1061786&r2=1061787&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/parser/AstIdentifier.java (original)
+++ tomcat/trunk/java/org/apache/el/parser/AstIdentifier.java Fri Jan 21
12:39:15 2011
@@ -129,8 +129,8 @@ public final class AstIdentifier extends
@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;
}
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1061787&r1=1061786&r2=1061787&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Jan 21 12:39:15 2011
@@ -97,6 +97,10 @@
<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">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]