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

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.3, 5.4
    • 5.4
    • tapestry-ioc
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            hlship Howard Lewis Ship
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment