harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Svetlana Samoilenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-358) java.beans.Beans.instantiate(ClassLoader cls, String name) throws ClassNotFoundException if cls == null
Date Mon, 17 Apr 2006 12:21:54 GMT
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


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