From: markt Date: Fri, 21 Jan 2011 12:39:15 +0000 (+0000) Subject: Improve error message & use i18n X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=89fc5a19bcc25dd2325a82322bf22a2acc448562;p=tomcat7.0 Improve error message & use i18n git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1061787 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/el/Messages.properties b/java/org/apache/el/Messages.properties index bfd89faf5..7fdc6f20d 100644 --- a/java/org/apache/el/Messages.properties +++ b/java/org/apache/el/Messages.properties @@ -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 diff --git a/java/org/apache/el/parser/AstDotSuffix.java b/java/org/apache/el/parser/AstDotSuffix.java index 0463b5a57..0b0307b79 100644 --- a/java/org/apache/el/parser/AstDotSuffix.java +++ b/java/org/apache/el/parser/AstDotSuffix.java @@ -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; } diff --git a/java/org/apache/el/parser/AstIdentifier.java b/java/org/apache/el/parser/AstIdentifier.java index de7f3603e..d51e94dee 100644 --- a/java/org/apache/el/parser/AstIdentifier.java +++ b/java/org/apache/el/parser/AstIdentifier.java @@ -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; } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index acbabda64..204cdbdec 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -97,6 +97,10 @@ 15688: Use fully-qualified class names in generated jsp files to avoid naming conflicts with user imports. (markt) + + Improve error message when EL identifiers are not valid Java identifiers + and use i18n for the error message. (markt) +