Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4087823

Beans.instantiate(cl, beanName) works wrong with applet under Win95

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.1.4
    • client-libs
    • x86
    • windows_95



      Name: dsC58869 Date: 10/21/97



      The method java.beans.Beans.instantiate(ClassLoader cl, String beanName)
      works wrong instantiating an applet with system class loader under Windows95.
      This bug was introduced in JDK1.1.4.


      ==== Here is the test demonstrating the bug ====
      --- SimpleApplet.java ---
      import java.applet.*;

      public class SimpleApplet extends Applet{}
      --- --- --- --- --- ---

      --- Test.java ---
      import java.beans.*;
      import java.applet.*;
      public class Test{
          
          public static void main(String[] args){
      Test test = new Test();
          }
          Test(){
      String bname = "SimpleApplet";
      Class bclass = SimpleApplet.class;
      SimpleApplet bean;
      try {
      ClassLoader cl = this.getClass().getClassLoader();
      bean = (SimpleApplet) Beans.instantiate(cl, bname);
      } catch (Exception ex) {
      ex.printStackTrace();
      }
          }
      }
      --- --- --- ---

      ==== Here is the output of the test ====

      C:\home\sda\tmp>java Test
      java.net.MalformedURLException: systemresource:/FILE./+/: java.lang.SecurityExce
      ption: systemresource:/FILE./+/ refers to a non system resource
              at java.net.URL.<init>(URL.java:372)
              at java.net.URL.<init>(URL.java:254)
              at java.beans.Beans.instantiate(Beans.java:177)
              at Test.<init>(Test.java:14)
              at Test.main(Test.java:6)

      ======================================================================

      ======================================================================

            Unassigned Unassigned
            dsilaev Dmitri Silaev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: