harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-358) java.beans.Beans.instantiate(ClassLoader cls, String name) throws ClassNotFoundException if cls == null
Date Tue, 18 Apr 2006 06:29:19 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-358?page=all ]
     
Mikhail Loenko resolved HARMONY-358:
------------------------------------

    Resolution: Fixed

fixed in revision 394857
Svetlana, please verify if it fully resolves your problem

> 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


Mime
View raw message