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,


--
Alexei Zakharov,
Intel Middleware Product Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to