You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Svetlana Samoilenko (JIRA)" <ji...@apache.org> on 2006/04/24 14:37:06 UTC
[jira] Created: (HARMONY-402) java.beans.Beans.InstanceOf(Object
bean,Class targetType) method works incorrectly
java.beans.Beans.InstanceOf(Object bean,Class targetType) method works incorrectly
----------------------------------------------------------------------------------
Key: HARMONY-402
URL: http://issues.apache.org/jira/browse/HARMONY-402
Project: Harmony
Type: Bug
Components: Classlib
Reporter: Svetlana Samoilenko
Accodring to java 1.4.2 and 1.5 specifications java.beans.Beans.InstanceOf(Object bean,Class targetType) method returns "true" if the given bean supports the given targetType.
As a result isInstanceOf(Object bean, null) should return false.
Harmony throws NPE in this case and returns false for correct non-null targetType.
Code for reproduce:
Put ObjectBean class in the same directory as the test.
import java.beans.Beans;
import java.io.*;
public class test {
public static void main(String[] args) {
ObjectBean bean = new ObjectBean();
try {
Class targetType = Externalizable.class;
//correct non-null targetType
System.out.println("***"+Beans.isInstanceOf(bean, targetType));
} catch (Exception e) {
e.printStackTrace();
}
try {
Class targetType = null;
// null targetType
System.out.println("***"+Beans.isInstanceOf(bean, targetType));
} catch (Exception e) {
e.printStackTrace();
}
}
}
class ObjectBean implements Externalizable {
public void writeExternal(ObjectOutput out) {};
public void readExternal(ObjectInput in){};
}
Harmony output:
***false
java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
at java.beans.Beans.isInstanceOf(Beans.java:147)
at test.main(test.java:18)
BEA optput:
***true
***false
--
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-402) java.beans.Beans.InstanceOf(Object
bean,Class targetType) method works incorrectly
Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-402?page=all ]
Mikhail Loenko closed HARMONY-402:
----------------------------------
verified by Svetlana
> java.beans.Beans.InstanceOf(Object bean,Class targetType) method works incorrectly
> ----------------------------------------------------------------------------------
>
> Key: HARMONY-402
> URL: http://issues.apache.org/jira/browse/HARMONY-402
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Assignee: Mikhail Loenko
> Attachments: Beans.diffs, BeansTest.java, ObjectBean.java
>
> Accodring to java 1.4.2 and 1.5 specifications java.beans.Beans.InstanceOf(Object bean,Class targetType) method returns "true" if the given bean supports the given targetType.
> As a result isInstanceOf(Object bean, null) should return false.
> Harmony throws NPE in this case and returns false for correct non-null targetType.
>
> Code for reproduce:
> Put ObjectBean class in the same directory as the test.
> import java.beans.Beans;
> import java.io.*;
>
> public class test {
> public static void main(String[] args) {
> ObjectBean bean = new ObjectBean();
>
> try {
> Class targetType = Externalizable.class;
> //correct non-null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> try {
> Class targetType = null;
> // null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
>
> class ObjectBean implements Externalizable {
> public void writeExternal(ObjectOutput out) {};
> public void readExternal(ObjectInput in){};
> }
> Harmony output:
> ***false
> java.lang.NullPointerException
> at java.lang.Class.isAssignableFrom(Native Method)
> at java.beans.Beans.isInstanceOf(Beans.java:147)
> at test.main(test.java:18)
> BEA optput:
> ***true
> ***false
>
--
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] Updated: (HARMONY-402) java.beans.Beans.InstanceOf(Object
bean,Class targetType) method works incorrectly
Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-402?page=all ]
Svetlana Samoilenko updated HARMONY-402:
----------------------------------------
Attachment: Beans.diffs
Unit test is coming.
> java.beans.Beans.InstanceOf(Object bean,Class targetType) method works incorrectly
> ----------------------------------------------------------------------------------
>
> Key: HARMONY-402
> URL: http://issues.apache.org/jira/browse/HARMONY-402
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Attachments: Beans.diffs
>
> Accodring to java 1.4.2 and 1.5 specifications java.beans.Beans.InstanceOf(Object bean,Class targetType) method returns "true" if the given bean supports the given targetType.
> As a result isInstanceOf(Object bean, null) should return false.
> Harmony throws NPE in this case and returns false for correct non-null targetType.
>
> Code for reproduce:
> Put ObjectBean class in the same directory as the test.
> import java.beans.Beans;
> import java.io.*;
>
> public class test {
> public static void main(String[] args) {
> ObjectBean bean = new ObjectBean();
>
> try {
> Class targetType = Externalizable.class;
> //correct non-null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> try {
> Class targetType = null;
> // null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
>
> class ObjectBean implements Externalizable {
> public void writeExternal(ObjectOutput out) {};
> public void readExternal(ObjectInput in){};
> }
> Harmony output:
> ***false
> java.lang.NullPointerException
> at java.lang.Class.isAssignableFrom(Native Method)
> at java.beans.Beans.isInstanceOf(Beans.java:147)
> at test.main(test.java:18)
> BEA optput:
> ***true
> ***false
>
--
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-402) java.beans.Beans.InstanceOf(Object
bean,Class targetType) method works incorrectly
Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-402?page=comments#action_12376423 ]
Svetlana Samoilenko commented on HARMONY-402:
---------------------------------------------
Mikhail,
thank you, I can't reproduce it with latest sources.
> java.beans.Beans.InstanceOf(Object bean,Class targetType) method works incorrectly
> ----------------------------------------------------------------------------------
>
> Key: HARMONY-402
> URL: http://issues.apache.org/jira/browse/HARMONY-402
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Assignee: Mikhail Loenko
> Attachments: Beans.diffs, BeansTest.java, ObjectBean.java
>
> Accodring to java 1.4.2 and 1.5 specifications java.beans.Beans.InstanceOf(Object bean,Class targetType) method returns "true" if the given bean supports the given targetType.
> As a result isInstanceOf(Object bean, null) should return false.
> Harmony throws NPE in this case and returns false for correct non-null targetType.
>
> Code for reproduce:
> Put ObjectBean class in the same directory as the test.
> import java.beans.Beans;
> import java.io.*;
>
> public class test {
> public static void main(String[] args) {
> ObjectBean bean = new ObjectBean();
>
> try {
> Class targetType = Externalizable.class;
> //correct non-null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> try {
> Class targetType = null;
> // null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
>
> class ObjectBean implements Externalizable {
> public void writeExternal(ObjectOutput out) {};
> public void readExternal(ObjectInput in){};
> }
> Harmony output:
> ***false
> java.lang.NullPointerException
> at java.lang.Class.isAssignableFrom(Native Method)
> at java.beans.Beans.isInstanceOf(Beans.java:147)
> at test.main(test.java:18)
> BEA optput:
> ***true
> ***false
>
--
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] Assigned: (HARMONY-402) java.beans.Beans.InstanceOf(Object
bean,Class targetType) method works incorrectly
Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-402?page=all ]
Mikhail Loenko reassigned HARMONY-402:
--------------------------------------
Assign To: Mikhail Loenko
> java.beans.Beans.InstanceOf(Object bean,Class targetType) method works incorrectly
> ----------------------------------------------------------------------------------
>
> Key: HARMONY-402
> URL: http://issues.apache.org/jira/browse/HARMONY-402
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Assignee: Mikhail Loenko
> Attachments: Beans.diffs
>
> Accodring to java 1.4.2 and 1.5 specifications java.beans.Beans.InstanceOf(Object bean,Class targetType) method returns "true" if the given bean supports the given targetType.
> As a result isInstanceOf(Object bean, null) should return false.
> Harmony throws NPE in this case and returns false for correct non-null targetType.
>
> Code for reproduce:
> Put ObjectBean class in the same directory as the test.
> import java.beans.Beans;
> import java.io.*;
>
> public class test {
> public static void main(String[] args) {
> ObjectBean bean = new ObjectBean();
>
> try {
> Class targetType = Externalizable.class;
> //correct non-null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> try {
> Class targetType = null;
> // null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
>
> class ObjectBean implements Externalizable {
> public void writeExternal(ObjectOutput out) {};
> public void readExternal(ObjectInput in){};
> }
> Harmony output:
> ***false
> java.lang.NullPointerException
> at java.lang.Class.isAssignableFrom(Native Method)
> at java.beans.Beans.isInstanceOf(Beans.java:147)
> at test.main(test.java:18)
> BEA optput:
> ***true
> ***false
>
--
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] Resolved: (HARMONY-402) java.beans.Beans.InstanceOf(Object
bean,Class targetType) method works incorrectly
Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-402?page=all ]
Mikhail Loenko resolved HARMONY-402:
------------------------------------
Resolution: Fixed
fixed in revision 396838
Svetlana, please check that it fully resolves the problem
> java.beans.Beans.InstanceOf(Object bean,Class targetType) method works incorrectly
> ----------------------------------------------------------------------------------
>
> Key: HARMONY-402
> URL: http://issues.apache.org/jira/browse/HARMONY-402
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Assignee: Mikhail Loenko
> Attachments: Beans.diffs, BeansTest.java, ObjectBean.java
>
> Accodring to java 1.4.2 and 1.5 specifications java.beans.Beans.InstanceOf(Object bean,Class targetType) method returns "true" if the given bean supports the given targetType.
> As a result isInstanceOf(Object bean, null) should return false.
> Harmony throws NPE in this case and returns false for correct non-null targetType.
>
> Code for reproduce:
> Put ObjectBean class in the same directory as the test.
> import java.beans.Beans;
> import java.io.*;
>
> public class test {
> public static void main(String[] args) {
> ObjectBean bean = new ObjectBean();
>
> try {
> Class targetType = Externalizable.class;
> //correct non-null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> try {
> Class targetType = null;
> // null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
>
> class ObjectBean implements Externalizable {
> public void writeExternal(ObjectOutput out) {};
> public void readExternal(ObjectInput in){};
> }
> Harmony output:
> ***false
> java.lang.NullPointerException
> at java.lang.Class.isAssignableFrom(Native Method)
> at java.beans.Beans.isInstanceOf(Beans.java:147)
> at test.main(test.java:18)
> BEA optput:
> ***true
> ***false
>
--
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] Updated: (HARMONY-402) java.beans.Beans.InstanceOf(Object
bean,Class targetType) method works incorrectly
Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-402?page=all ]
Svetlana Samoilenko updated HARMONY-402:
----------------------------------------
Attachment: BeansTest.java
ObjectBean.java
unit test
> java.beans.Beans.InstanceOf(Object bean,Class targetType) method works incorrectly
> ----------------------------------------------------------------------------------
>
> Key: HARMONY-402
> URL: http://issues.apache.org/jira/browse/HARMONY-402
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Assignee: Mikhail Loenko
> Attachments: Beans.diffs, BeansTest.java, ObjectBean.java
>
> Accodring to java 1.4.2 and 1.5 specifications java.beans.Beans.InstanceOf(Object bean,Class targetType) method returns "true" if the given bean supports the given targetType.
> As a result isInstanceOf(Object bean, null) should return false.
> Harmony throws NPE in this case and returns false for correct non-null targetType.
>
> Code for reproduce:
> Put ObjectBean class in the same directory as the test.
> import java.beans.Beans;
> import java.io.*;
>
> public class test {
> public static void main(String[] args) {
> ObjectBean bean = new ObjectBean();
>
> try {
> Class targetType = Externalizable.class;
> //correct non-null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> try {
> Class targetType = null;
> // null targetType
> System.out.println("***"+Beans.isInstanceOf(bean, targetType));
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
>
> class ObjectBean implements Externalizable {
> public void writeExternal(ObjectOutput out) {};
> public void readExternal(ObjectInput in){};
> }
> Harmony output:
> ***false
> java.lang.NullPointerException
> at java.lang.Class.isAssignableFrom(Native Method)
> at java.beans.Beans.isInstanceOf(Beans.java:147)
> at test.main(test.java:18)
> BEA optput:
> ***true
> ***false
>
--
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