You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jochen Kemnade (JIRA)" <ji...@apache.org> on 2015/08/18 09:37:46 UTC
[jira] [Commented] (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
[ https://issues.apache.org/jira/browse/TAP5-1813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14700856#comment-14700856 ]
Jochen Kemnade commented on TAP5-1813:
--------------------------------------
Can be reproduced by placing the following code in a module class
{code}
public static interface Provider {
Object provide();
}
@EagerLoad
public static Provider build(final StrategyBuilder builder, final Map<Class, Provider> configuration) {
return builder.build(Provider.class, configuration);
}
{code}
> 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
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: TAP5-1813
> URL: https://issues.apache.org/jira/browse/TAP5-1813
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-ioc
> Affects Versions: 5.3, 5.4
> Reporter: Howard M. Lewis Ship
> Priority: Minor
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)