You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2010/01/18 20:38:54 UTC
[jira] Created: (HARMONY-6422) StandardBeanInfo behaves differently
from RI GenericBeanInfo
StandardBeanInfo behaves differently from RI GenericBeanInfo
------------------------------------------------------------
Key: HARMONY-6422
URL: https://issues.apache.org/jira/browse/HARMONY-6422
Project: Harmony
Issue Type: Bug
Components: Classlib
Reporter: Sebb
StandardBeanInfo behaves differently from RI GenericBeanInfo:
-----cut here-------
import java.beans.BeanInfo;
import java.beans.Introspector;
public class BeanTest {
public static void main(String[] args) throws Exception {
BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
beanInfo.getBeanDescriptor().setDisplayName("test");
System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
}
}
-----cut here-------
This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-6422) StandardBeanInfo behaves differently
from RI GenericBeanInfo
Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Zhou updated HARMONY-6422:
--------------------------------
Attachment: HARMONY-6422v2.diff
Refine the patch and add a test case
> StandardBeanInfo behaves differently from RI GenericBeanInfo
> ------------------------------------------------------------
>
> Key: HARMONY-6422
> URL: https://issues.apache.org/jira/browse/HARMONY-6422
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Sebb
> Attachments: HARMONY-6422.diff, HARMONY-6422v2.diff
>
>
> StandardBeanInfo behaves differently from RI GenericBeanInfo:
> -----cut here-------
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> public class BeanTest {
> public static void main(String[] args) throws Exception {
> BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
> System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
> beanInfo.getBeanDescriptor().setDisplayName("test");
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
> }
> }
> -----cut here-------
> This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
> I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6422) StandardBeanInfo behaves
differently from RI GenericBeanInfo
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802599#action_12802599 ]
Nathan Beyer commented on HARMONY-6422:
---------------------------------------
Just to verify - you meant that the IBM JRE worked like the RI, correct?
> StandardBeanInfo behaves differently from RI GenericBeanInfo
> ------------------------------------------------------------
>
> Key: HARMONY-6422
> URL: https://issues.apache.org/jira/browse/HARMONY-6422
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Sebb
>
> StandardBeanInfo behaves differently from RI GenericBeanInfo:
> -----cut here-------
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> public class BeanTest {
> public static void main(String[] args) throws Exception {
> BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
> System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
> beanInfo.getBeanDescriptor().setDisplayName("test");
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
> }
> }
> -----cut here-------
> This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
> I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6422) StandardBeanInfo behaves
differently from RI GenericBeanInfo
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802217#action_12802217 ]
Sebb commented on HARMONY-6422:
-------------------------------
Good point.
I've got round the problem in JMeter by caching the return value, which should be slighlty more efficient anyway.
Note that the behaviour is the same in IBM Java. Here are the details from the JMeter user who got an NPE (caused by the loss of info):
$: java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap6460sr4-20090219_01(SR4))
IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 AIX ppc64-64
jvmap6460-20090215_29883 (JIT enabled, AOT enabled)
J9VM - 20090215_029883_BHdSMr
JIT - r9_20090213_2028
GC - 20090213_AA)
JCL - 20090218_01
> StandardBeanInfo behaves differently from RI GenericBeanInfo
> ------------------------------------------------------------
>
> Key: HARMONY-6422
> URL: https://issues.apache.org/jira/browse/HARMONY-6422
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Sebb
>
> StandardBeanInfo behaves differently from RI GenericBeanInfo:
> -----cut here-------
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> public class BeanTest {
> public static void main(String[] args) throws Exception {
> BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
> System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
> beanInfo.getBeanDescriptor().setDisplayName("test");
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
> }
> }
> -----cut here-------
> This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
> I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HARMONY-6422) StandardBeanInfo behaves
differently from RI GenericBeanInfo
Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Zhou reassigned HARMONY-6422:
-----------------------------------
Assignee: Kevin Zhou
> StandardBeanInfo behaves differently from RI GenericBeanInfo
> ------------------------------------------------------------
>
> Key: HARMONY-6422
> URL: https://issues.apache.org/jira/browse/HARMONY-6422
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Sebb
> Assignee: Kevin Zhou
> Attachments: HARMONY-6422.diff, HARMONY-6422v2.diff
>
>
> StandardBeanInfo behaves differently from RI GenericBeanInfo:
> -----cut here-------
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> public class BeanTest {
> public static void main(String[] args) throws Exception {
> BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
> System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
> beanInfo.getBeanDescriptor().setDisplayName("test");
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
> }
> }
> -----cut here-------
> This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
> I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6422) StandardBeanInfo behaves
differently from RI GenericBeanInfo
Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870532#action_12870532 ]
Kevin Zhou commented on HARMONY-6422:
-------------------------------------
I just found that this issue seems to be duplicated to HARMONY-6355. Charles has provided a similar patch.
> StandardBeanInfo behaves differently from RI GenericBeanInfo
> ------------------------------------------------------------
>
> Key: HARMONY-6422
> URL: https://issues.apache.org/jira/browse/HARMONY-6422
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Sebb
> Attachments: HARMONY-6422.diff
>
>
> StandardBeanInfo behaves differently from RI GenericBeanInfo:
> -----cut here-------
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> public class BeanTest {
> public static void main(String[] args) throws Exception {
> BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
> System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
> beanInfo.getBeanDescriptor().setDisplayName("test");
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
> }
> }
> -----cut here-------
> This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
> I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6422) StandardBeanInfo behaves
differently from RI GenericBeanInfo
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802027#action_12802027 ]
Nathan Beyer commented on HARMONY-6422:
---------------------------------------
Hmm ... a BeanDescriptor is defined as "global information", so it seems like it SHOULD record any changes, regardless of whether a new BeanDescriptor instance is returned each time.
> StandardBeanInfo behaves differently from RI GenericBeanInfo
> ------------------------------------------------------------
>
> Key: HARMONY-6422
> URL: https://issues.apache.org/jira/browse/HARMONY-6422
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Sebb
>
> StandardBeanInfo behaves differently from RI GenericBeanInfo:
> -----cut here-------
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> public class BeanTest {
> public static void main(String[] args) throws Exception {
> BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
> System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
> beanInfo.getBeanDescriptor().setDisplayName("test");
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
> }
> }
> -----cut here-------
> This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
> I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6422) StandardBeanInfo behaves
differently from RI GenericBeanInfo
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803026#action_12803026 ]
Sebb commented on HARMONY-6422:
-------------------------------
No - the IBM JRE behaves like Harmony, which is why the JMeter user got the NPE.
> StandardBeanInfo behaves differently from RI GenericBeanInfo
> ------------------------------------------------------------
>
> Key: HARMONY-6422
> URL: https://issues.apache.org/jira/browse/HARMONY-6422
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Sebb
>
> StandardBeanInfo behaves differently from RI GenericBeanInfo:
> -----cut here-------
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> public class BeanTest {
> public static void main(String[] args) throws Exception {
> BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
> System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
> beanInfo.getBeanDescriptor().setDisplayName("test");
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
> }
> }
> -----cut here-------
> This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
> I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HARMONY-6422) StandardBeanInfo behaves
differently from RI GenericBeanInfo
Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Zhou resolved HARMONY-6422.
---------------------------------
Resolution: Fixed
Patch applied at r952132, Thanks
> StandardBeanInfo behaves differently from RI GenericBeanInfo
> ------------------------------------------------------------
>
> Key: HARMONY-6422
> URL: https://issues.apache.org/jira/browse/HARMONY-6422
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Sebb
> Assignee: Kevin Zhou
> Attachments: HARMONY-6422.diff, HARMONY-6422v2.diff
>
>
> StandardBeanInfo behaves differently from RI GenericBeanInfo:
> -----cut here-------
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> public class BeanTest {
> public static void main(String[] args) throws Exception {
> BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
> System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
> beanInfo.getBeanDescriptor().setDisplayName("test");
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
> }
> }
> -----cut here-------
> This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
> I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6422) StandardBeanInfo behaves
differently from RI GenericBeanInfo
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803264#action_12803264 ]
Tim Ellison commented on HARMONY-6422:
--------------------------------------
That IBM JRE contains Harmony's beans implementation, so I'd expect them to behave the same.
> StandardBeanInfo behaves differently from RI GenericBeanInfo
> ------------------------------------------------------------
>
> Key: HARMONY-6422
> URL: https://issues.apache.org/jira/browse/HARMONY-6422
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Sebb
>
> StandardBeanInfo behaves differently from RI GenericBeanInfo:
> -----cut here-------
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> public class BeanTest {
> public static void main(String[] args) throws Exception {
> BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
> System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
> beanInfo.getBeanDescriptor().setDisplayName("test");
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
> }
> }
> -----cut here-------
> This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
> I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-6422) StandardBeanInfo behaves differently
from RI GenericBeanInfo
Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Zhou updated HARMONY-6422:
--------------------------------
Attachment: HARMONY-6422.diff
Would this patch fix this problem ? Correct me if there is something wrong, thanks!
> StandardBeanInfo behaves differently from RI GenericBeanInfo
> ------------------------------------------------------------
>
> Key: HARMONY-6422
> URL: https://issues.apache.org/jira/browse/HARMONY-6422
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Sebb
> Attachments: HARMONY-6422.diff
>
>
> StandardBeanInfo behaves differently from RI GenericBeanInfo:
> -----cut here-------
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> public class BeanTest {
> public static void main(String[] args) throws Exception {
> BeanInfo beanInfo = Introspector.getBeanInfo(BeanTest.class);
> System.out.println(beanInfo.getClass().getName()); // RI=GenericBeanInfo, Harmony=StandardBeanInfo
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName()); // BeanTest (both)
> beanInfo.getBeanDescriptor().setDisplayName("test");
> System.out.println(beanInfo.getBeanDescriptor().getDisplayName());// test (RI) BeanTest (Harmony)
> }
> }
> -----cut here-------
> This is because the RI always returns the same instance from getBeanDescriptor() whereas Harmony returns a new instance.
> I don't know if this is a spec. violation or not, but the behaviour is different and unexpected, so should at least be documented in the BeanInfo Javadoc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.