[prev in list] [next in list] [prev in thread] [next in thread]
List: activemq-dev
Subject: Re: java.lang.IllegalArgumentException: wrong number of arguments
From: Christopher Shannon <christopher.l.shannon () gmail ! com>
Date: 2016-06-23 20:37:18
Message-ID: CACHnxzwmjZA9SyN+=YJYd-B9g_kv5bj4EcwbfM23oABWSobsgg () mail ! gmail ! com
[Download RAW message or body]
Thanks for pointing that out, this change makes sense to me. I fixed it
here https://issues.apache.org/jira/browse/AMQ-6337
On Thu, Jun 23, 2016 at 3:34 PM, Pierre Ernst <pierre.ernst@gmail.com>
wrote:
> I found an issue at these 2 lines:
>
>
> https://github.com/apache/activemq/blob/e2b4ca2c59a316be91cf391c758a10e518dd3a1f/act \
> ivemq-broker/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java#L244
>
>
> https://github.com/apache/activemq/blob/e2b4ca2c59a316be91cf391c758a10e518dd3a1f/act \
> ivemq-broker/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java#L256
>
> the test:
> paramTypes.length != 0
> should be replaced by:
> paramTypes.length ==1
>
> Otherwise, the code might attempt to call a constructor/setter for which
> the 1st parameter is a String (but having potentially other parameters)
> with only a single value.
>
> e.g. imagine this class:
>
> public class MyClass {
>
> public MyClass (String s, int i) {
> }
>
> public MyClass (String s) {
> }
> }
>
> Depending on the order in the bytecode, the 1st constructor (String, int)
> might be selected and the class will be initialized with constructors[i].
> newInstance(new Object[]{name}), resulting
> in java.lang.IllegalArgumentException: wrong number of arguments
>
> Hoping it helps
>
>
> --
> Pierre Ernst
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic