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/18 10:53:17 UTC
[jira] Commented: (HARMONY-358)
java.beans.Beans.instantiate(ClassLoader cls, String name) throws
ClassNotFoundException if cls == null
[ http://issues.apache.org/jira/browse/HARMONY-358?page=comments#action_12374883 ]
Svetlana Samoilenko commented on HARMONY-358:
---------------------------------------------
Mikhail,
thank you, bug is not reproducible with latest sources.
> java.beans.Beans.instantiate(ClassLoader cls, String name) throws ClassNotFoundException if cls == null
> -------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-358
> URL: http://issues.apache.org/jira/browse/HARMONY-358
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Attachments: BeansTest.java, patch.txt
>
> Accodring to java 1.4.2 and 1.5 specifications for java.beans.Beans.instantiate(Classloader cls, String name)
> "If cls is null, then the system class-loader is used". Harmony does not set system class-loader and throws
> ClassNotFoundException if class "name" exists and cls == null.
> RI (BEA 1.5) works correctly.
> Code for reproduce:
> Put MyClass.class in the same directory as the test.
> test.java:
> import java.beans.Beans;
> public class test {
> public static void main(String[] args) {
> try {
> Class myclass=Class.forName(MyClass.class.getName());
> Object bns = Beans.instantiate(null, myclass);
> System.out.println("bns="+bns);
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> MyClass.java:
> public class MyClass {
> };
> Harmony output:
> java.lang.ClassNotFoundException: MyClass
> at java.lang.Class.forName()
> at java.beans.Beans.instantiate()
> at test.main(test.java:6)
> BEA optput:
> bns=MyClass@206a163
--
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