Uploaded image for project: 'Commons OGNL (Dormant)'
  1. Commons OGNL (Dormant)
  2. OGNL-150

Ognl.compileExpression fails when calling constructor with an argument of type long.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7
    • None
    • ExpressionCompiler
    • None
    • It affects all ognl 2.7 versions until 2.7.3

    Description

      When compiling an expression of the form: new MyObject(MyObj.LongValue) OGNL fails with:

      Exception in thread "main" javassist.CannotCompileException: [source error] ) is missing

      at javassist.CtBehavior.setBody(CtBehavior.java:367)

      at javassist.CtBehavior.setBody(CtBehavior.java:334)

      at ognl.enhance.ExpressionCompiler.generateGetter(ExpressionCompiler.java:536)

      at ognl.enhance.ExpressionCompiler.compileExpression(ExpressionCompiler.java:403)

      at ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:414)

      at ognl.Ognl.compileExpression(Ognl.java:141)

      at OgnlTest.main(OgnlTest.java:13)

      Caused by: compile error: ) is missing

      at javassist.compiler.Parser.parseArgumentList(Parser.java:1337)

      at javassist.compiler.Parser.parseNew(Parser.java:1278)

      at javassist.compiler.Parser.parsePrimaryExpr(Parser.java:1241)

      at javassist.compiler.Parser.parsePostfix(Parser.java:1029)

      at javassist.compiler.Parser.parseUnaryExpr(Parser.java:887)

      at javassist.compiler.Parser.parseBinaryExpr(Parser.java:774)

      at javassist.compiler.Parser.parseConditionalExpr(Parser.java:718)

      at javassist.compiler.Parser.parseExpression(Parser.java:698)

      at javassist.compiler.Parser.parseReturn(Parser.java:506)

      at javassist.compiler.Parser.parseStatement(Parser.java:268)

      at javassist.compiler.Parser.parseBlock(Parser.java:288)

      at javassist.compiler.Parser.parseStatement(Parser.java:242)

      at javassist.compiler.Javac.compileBody(Javac.java:213)

      at javassist.CtBehavior.setBody(CtBehavior.java:360)

      ... 6 more

      The bug does not show if the long value is a literal like: 100000L.

      Attachments

        Activity

          People

            jkuhnert Jesse Kuhnert
            anarxia Nicos Panayides
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: