harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib][beans] StatementTest - bug in RI?
Date Tue, 11 Jul 2006 17:20:40 GMT
Yeah, leave Harmony throwing NoSuchMethod' and log it as a non-bug
difference.

Regards,
Tim

Alexei Zakharov wrote:
> Hi,
> 
> Devoted to Harmony java.beans guru and others. )
> While trying to enable tests from
> org.apache.harmony.beans.tests.java.beans.StatementTest I have faced
> the strange problem. It seems that while building Statement for
> accessing array elements RI doesn't check the number of parameters of
> get() method. It simply takes the value of first argument, converts it
> to integer and does nothing more. Following (IMHO invalid) tests pass
> on RI:
> 
> Test1:
> Object[] array = new Object[] { "test" };
> Statement t = new Statement(array, "get", new Object[] {
>        new Integer(0), new Object() });
> t.execute();
> 
> Test2:
> Object[] array = new Object[] { "test" };
> Statement t = new Statement(array, "get", new Object[] {
>        new Integer(0), new Object(), new Integer[] {1,2,3,4,5,6},
>        new java.util.GregorianCalendar(), "mama mila ramu" });
> t.execute();
> 
> The spec states the following:
> "The method names 'get' and 'set' defined in the java.util.List
> interface may also be applied to array instances, mapping to the
> static methods of the same name in the Array class."
> 
> Therefore, since java.util.List defines 'get' method with excatly one
> integer argument I suppose the correct test should look like:
> 
> Test3:
> Object[] array = new Object[] { "test" };
> Statement t = new Statement(array, "get", new Object[] {
>        new Integer(0) });
> t.execute();
> 
> And Test1 and Test2 should throw NoSuchMethodException as our
> implementation currently does. However, all three tests pass on RI
> without exceptions. What should I do? Rise "Non-bug differences from
> RI" JIRA? Suggestions are welcome!
> 
> Thanks,
> 
> 

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message