Commons OGNL
  1. Commons OGNL
  2. OGNL-10

Calling methods with parameters containing more calls ?

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7
    • Component/s: ExpressionCompiler
    • Labels:
      None
    • Environment:
      ognl-2.7-20070303-020139-5

      Description

      Not sure if the title is correct but ...

      Trying to rewrite OGNL-9 i add in the .java
      @Message("page-title")
      public abstract String getTitle(int partnersCount);

      and use any of the expressions
      ognl:getTitle(partners.size)
      ognl:getTitle(partners.size())
      ognl:getTitle(getPartners().size())
      ognl:getTitle(getPartners().size)

      BTW, the .java contains a getPartners() method that returns a collection

      In the first case I get
      Error compiling expression on object $OurPartners_47@3c1[OurPartners] with expression node getTitle(partners.size) getter body: null setter body: nulljava.lang.ArrayIndexOutOfBoundsException: 0
      and in the others
      Error compiling expression on object $NonflowBorder_156@ea72b4a1[OurPartners/Border] with expression node title getter body: null setter body: nulltitle

      They all produce the same stacktrace:

      org.apache.tapestry.services.impl.HiveMindExpressionCompiler.compileExpression(HiveMindExpressionCompiler.java:258)
      ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:384)
      ognl.Ognl.compileExpression(Ognl.java:123)
      org.apache.tapestry.services.impl.ExpressionCacheImpl.parse(ExpressionCacheImpl.java:129)
      org.apache.tapestry.services.impl.ExpressionCacheImpl.getCompiledExpression(ExpressionCacheImpl.java:91)
      $ExpressionCache_1112ff335b1.getCompiledExpression($ExpressionCache_1112ff335b1.java)
      org.apache.tapestry.binding.ExpressionBinding.resolveExpression(ExpressionBinding.java:121)
      org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.java:112)
      org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:84)
      $Border_22.getTitle($NonflowBorder_22.java)
      ognl.ASTProperty4142218Accessor.get(ASTProperty4142218Accessor.java)
      org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.read(ExpressionEvaluatorImpl.java:131)
      $ExpressionEvaluator_1112ff335af.read($ExpressionEvaluator_1112ff335af.java)
      org.apache.tapestry.binding.ExpressionBinding.resolveExpression(ExpressionBinding.java:127)
      org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.java:112)
      org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:84)
      $Insert_6.getValue($Insert_6.java)
      org.apache.tapestry.components.Insert.renderComponent(Insert.java:48)
      org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:708)
      org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
      org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:521)
      org.apache.tapestry.html.Body.renderComponent(Body.java:38)
      org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:708)

        Activity

        Hide
        Jesse Kuhnert added a comment -

        I wasn't able to re-produce this issue, maybe I just need a more specific object structure?

        I used this test case:

        http://svn.opensymphony.com/svn/ognl/trunk/src/test/java/org/ognl/test/IndexedPropertyTest.java

        and this object:

        http://svn.opensymphony.com/svn/ognl/trunk/src/test/java/org/ognl/test/objects/Indexed.java

        Show
        Jesse Kuhnert added a comment - I wasn't able to re-produce this issue, maybe I just need a more specific object structure? I used this test case: http://svn.opensymphony.com/svn/ognl/trunk/src/test/java/org/ognl/test/IndexedPropertyTest.java and this object: http://svn.opensymphony.com/svn/ognl/trunk/src/test/java/org/ognl/test/objects/Indexed.java
        Hide
        Jesse Kuhnert added a comment -

        Resolving as not re-produceable for now as I haven't heard anything.

        Show
        Jesse Kuhnert added a comment - Resolving as not re-produceable for now as I haven't heard anything.
        Hide
        Andreas Andreou added a comment -

        Sorry, i thought i'd get an email or something upon each change in this issue - but i didn't, so

        I didn't really know you were working on this... perhaps this was positively affected by OGNL-9 's resolution?

        Anyway, i'll comment if there are more problems

        Show
        Andreas Andreou added a comment - Sorry, i thought i'd get an email or something upon each change in this issue - but i didn't, so I didn't really know you were working on this... perhaps this was positively affected by OGNL-9 's resolution? Anyway, i'll comment if there are more problems
        Hide
        Andreas Andreou added a comment -

        No, it's unrelated to OGNL-9 but i think i've found it...

        Assume that a Base class has a method

        String getTitle()

        {...}

        Subclass contains

        @Message("page-title")

        public abstract String getTitle(int messagesCount);

        Then all the mentioned expressions fail -

        even ognl:getTitle(1) fails...

        Probably trying to call the getTitle of the base that doesn't accept any arguments ???

        Show
        Andreas Andreou added a comment - No, it's unrelated to OGNL-9 but i think i've found it... Assume that a Base class has a method String getTitle() {...} Subclass contains @Message("page-title") public abstract String getTitle(int messagesCount); Then all the mentioned expressions fail - even ognl:getTitle(1) fails... Probably trying to call the getTitle of the base that doesn't accept any arguments ???

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Andreas Andreou
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development