jakartaee / expression-language

Jakarta Expression Language
https://eclipse.org/ee4j/el
Other
68 stars 49 forks source link

Escaping of curly braces broken #34

Closed glassfishrobot closed 4 years ago

glassfishrobot commented 10 years ago
public static void main(String[] args) throws Exception {
        // Works
        new com.sun.el.parser.ELParser(new StringReader("#{'\\''}")).CompositeExpression();
        // Doesn't work
        new com.sun.el.parser.ELParser(new StringReader("#{'\\{'}")).CompositeExpression();
    }
Exception in thread "main" com.sun.el.parser.ParseException: Encountered "\'\\{" at line 1, column 3.
Was expecting one of:
    "{" ...
    <INTEGER_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <STRING_LITERAL> ...
    "true" ...
    "false" ...
    "null" ...
    "(" ...
    "[" ...
    "!" ...
    "not" ...
    "empty" ...
    "-" ...
    <IDENTIFIER> ...
    <IDENTIFIER> ...
    "(" ...

    at com.sun.el.parser.ELParser.generateParseException(ELParser.java:2963)
    at com.sun.el.parser.ELParser.jj_consume_token(ELParser.java:2845)
    at com.sun.el.parser.ELParser.Assignment(ELParser.java:279)
    at com.sun.el.parser.ELParser.SemiColon(ELParser.java:181)
    at com.sun.el.parser.ELParser.Expression(ELParser.java:174)
    at com.sun.el.parser.ELParser.DeferredExpression(ELParser.java:112)
    at com.sun.el.parser.ELParser.CompositeExpression(ELParser.java:40)
    at Main.main(Main.java:9)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Environment

javax.el-3.0-b07.jar

glassfishrobot commented 6 years ago
glassfishrobot commented 10 years ago

@glassfishrobot Commented Reported by cbauer123

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA UEL-34

markt-asf commented 4 years ago

The EL specification does not permit the escaping of "{" in EL.