Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-181

Cannot create inline Map with array or function call as the key

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 3.0
    • Labels:
      None

      Description

      It seems that inline maps can be created only if:

      • the keys are string literals or a numbers
      • the keys are variables

      The followings throw exception:

      { ['1', '2'] : someValue }
      { myVar.callFunction() : someValue }
      

      Example stacktrace for expression:

      { 'step'.toString() : [1, 2] }
      org.apache.commons.jexl2.JexlException$Parsing: @1:21 parsing error near '... g() : [1,  ...'
           at org.apache.commons.jexl2.JexlEngine.parse(JexlEngine.java:1260)
           at org.apache.commons.jexl2.JexlEngine.createScript(JexlEngine.java:506)
           at org.everit.expression.jexl.JexlExpressionCompiler.compile(JexlExpressionCompiler.java:63)
           at org.everit.templating.html.internal.HTMLNodeVisitor.compileExpression(HTMLNodeVisitor.java:174)
           at org.everit.templating.html.internal.HTMLNodeVisitor.processEhtAttribute(HTMLNodeVisitor.java:406)
           at org.everit.templating.html.internal.HTMLNodeVisitor.fillEhtTagNodeWithAttribute(HTMLNodeVisitor.java:190)
           at org.everit.templating.html.internal.HTMLNodeVisitor.handleEWTNode(HTMLNodeVisitor.java:270)
           at org.everit.templating.html.internal.HTMLNodeVisitor.visitTag(HTMLNodeVisitor.java:634)
           at org.htmlparser.nodes.TagNode.accept(TagNode.java:700)
           at org.everit.templating.html.HTMLTemplateCompiler.compile(HTMLTemplateCompiler.java:125)
           at biz.everit.therapy.portal.WebTemplateRenderer.<init>(WebTemplateRenderer.java:57)
           at biz.everit.therapy.series.demo.DemoSeriesServlet.<init>(DemoSeriesServlet.java:46)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
           at java.lang.Class.newInstance(Class.java:442)
           at org.everit.osgi.ecm.component.ri.internal.ComponentContextImpl.starting(ComponentContextImpl.java:760)
           at org.everit.osgi.ecm.component.ri.internal.ComponentContextImpl.open(ComponentContextImpl.java:564)
           at org.everit.osgi.ecm.component.ri.internal.ComponentContainerImpl.open(ComponentContainerImpl.java:110)
           at org.everit.osgi.ecm.extender.ri.internal.ECMCapabilityTracker.addingBundle(ECMCapabilityTracker.java:105)
           at org.everit.osgi.ecm.extender.ri.internal.ECMCapabilityTracker.addingBundle(ECMCapabilityTracker.java:44)
           at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)
           at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1)
           at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
           at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
           at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
           at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:902)
           at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
           at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
           at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)
           at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)
           at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
           at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)
           at org.eclipse.osgi.container.Module.publishEvent(Module.java:466)
           at org.eclipse.osgi.container.Module.start(Module.java:457)
           at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:392)
           at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:411)
           at org.everit.osgi.dev.richconsole.internal.upgrade.UpgradeProcess.finish(UpgradeProcess.java:243)
           at org.everit.osgi.dev.richconsole.internal.upgrade.UpgradeServiceImpl.deployBundles(UpgradeServiceImpl.java:116)
           at org.everit.osgi.dev.richconsole.internal.BundleDeployerFrame$6$1.run(BundleDeployerFrame.java:242)
           at java.lang.Thread.run(Thread.java:745)
      Caused by: org.apache.commons.jexl2.parser.ParseException: parse error
           at org.apache.commons.jexl2.parser.Parser.generateParseException(Parser.java:3935)
           at org.apache.commons.jexl2.parser.Parser.jj_consume_token(Parser.java:3817)
           at org.apache.commons.jexl2.parser.Parser.Block(Parser.java:200)
           at org.apache.commons.jexl2.parser.Parser.Statement(Parser.java:110)
           at org.apache.commons.jexl2.parser.Parser.JexlScript(Parser.java:72)
           at org.apache.commons.jexl2.parser.Parser.parse(Parser.java:24)
           at org.apache.commons.jexl2.JexlEngine.parse(JexlEngine.java:1248)
           ... 41 more
      

        Attachments

          Activity

            People

            • Assignee:
              henrib Henri Biestro
              Reporter:
              balazs.zsoldos Balazs Zsoldos
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: