You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Zakharov (JIRA)" <ji...@apache.org> on 2006/07/14 20:41:15 UTC

[jira] Created: (HARMONY-882) [classlib][beans] differences in java.beans.Statement behavior

[classlib][beans] differences in java.beans.Statement behavior
--------------------------------------------------------------

                 Key: HARMONY-882
                 URL: http://issues.apache.org/jira/browse/HARMONY-882
             Project: Harmony
          Issue Type: Bug
          Components: Non-bug differences from RI
         Environment: winXP
            Reporter: Alexei Zakharov
            Priority: Minor


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 does.

So, the behavior of our implementation differs from RI. But RI's behavior looks unnatural in this case. It was decided [1] we should keep our behavior.

[1] http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200607.mbox/%3c44B3DDE8.1020904@gmail.com%3e

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (HARMONY-882) [classlib][beans] differences in java.beans.Statement behavior

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-882?page=all ]

Paulex Yang closed HARMONY-882.
-------------------------------

    Resolution: Won't Fix
      Assignee: Paulex Yang

Verified in dev-list as Non-Bug Difference with RI.

> [classlib][beans] differences in java.beans.Statement behavior
> --------------------------------------------------------------
>
>                 Key: HARMONY-882
>                 URL: http://issues.apache.org/jira/browse/HARMONY-882
>             Project: Harmony
>          Issue Type: Bug
>          Components: Non-bug differences from RI
>         Environment: winXP
>            Reporter: Alexei Zakharov
>         Assigned To: Paulex Yang
>            Priority: Minor
>
> 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 does.
> So, the behavior of our implementation differs from RI. But RI's behavior looks unnatural in this case. It was decided [1] we should keep our behavior.
> [1] http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200607.mbox/%3c44B3DDE8.1020904@gmail.com%3e

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-882) [classlib][beans] differences in java.beans.Statement behavior

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-882?page=comments#action_12434615 ] 
            
Tony Wu commented on HARMONY-882:
---------------------------------

should be closed 

> [classlib][beans] differences in java.beans.Statement behavior
> --------------------------------------------------------------
>
>                 Key: HARMONY-882
>                 URL: http://issues.apache.org/jira/browse/HARMONY-882
>             Project: Harmony
>          Issue Type: Bug
>          Components: Non-bug differences from RI
>         Environment: winXP
>            Reporter: Alexei Zakharov
>            Priority: Minor
>
> 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 does.
> So, the behavior of our implementation differs from RI. But RI's behavior looks unnatural in this case. It was decided [1] we should keep our behavior.
> [1] http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200607.mbox/%3c44B3DDE8.1020904@gmail.com%3e

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira