Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1813

Using StrategyBuilder service on an interface with a non-conforming method (one that does not include the selector as the initial parameter) throws an inscrutable ArrayIndexOutOfBounds exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.3, 5.4
    • Fix Version/s: 5.4
    • Component/s: tapestry-ioc
    • Labels:
      None

      Description

      Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
      at org.apache.tapestry5.internal.plastic.InstructionBuilderImpl.loadArgument(InstructionBuilderImpl.java:171) ~[plastic-5.3.1.jar:na]
      at org.apache.tapestry5.ioc.internal.services.StrategyBuilderImpl$1$1.doBuild(StrategyBuilderImpl.java:76) ~[tapestry-ioc-5.3.1.jar:na]
      at org.apache.tapestry5.internal.plastic.InstructionBuilderImpl.doCallback(InstructionBuilderImpl.java:832) ~[plastic-5.3.1.jar:na]
      at org.apache.tapestry5.internal.plastic.PlasticMethodImpl.changeImplementation(PlasticMethodImpl.java:130) ~[plastic-5.3.1.jar:na]
      at org.apache.tapestry5.internal.plastic.PlasticClassImpl.introduceMethod(PlasticClassImpl.java:647) ~[plastic-5.3.1.jar:na]
      at org.apache.tapestry5.ioc.internal.services.StrategyBuilderImpl$1.transform(StrategyBuilderImpl.java:65) ~[tapestry-ioc-5.3.1.jar:na]
      at org.apache.tapestry5.plastic.PlasticManager.createProxy(PlasticManager.java:235) ~[plastic-5.3.1.jar:na]
      at org.apache.tapestry5.ioc.internal.services.PlasticProxyFactoryImpl.createProxy(PlasticProxyFactoryImpl.java:60) ~[tapestry-ioc-5.3.1.jar:na]
      at org.apache.tapestry5.ioc.internal.services.StrategyBuilderImpl.createProxy(StrategyBuilderImpl.java:56) ~[tapestry-ioc-5.3.1.jar:na]
      at org.apache.tapestry5.ioc.internal.services.StrategyBuilderImpl.build(StrategyBuilderImpl.java:44) ~[tapestry-ioc-5.3.1.jar:na]
      at org.apache.tapestry5.ioc.internal.services.StrategyBuilderImpl.build(StrategyBuilderImpl.java:51) ~[tapestry-ioc-5.3.1.jar:na]
      at $StrategyBuilder_1265847ad7894079.build(Unknown Source) ~[na:na]

      This traces into code that attempts to load the first argument (argument 0, as Plastic numbers them) which fails because the method contains no parameters. A better case would be to check that each method takes at least one parameter, and preferably, find a way to ensure that the first parameter is the correct selector type.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hlship Howard M. Lewis Ship
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: