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

JCK1.4: api/java_lang/Class/index.html#Reflect, plugin

XMLWordPrintable

    • rc1
    • x86
    • linux, windows_nt
    • Verified

      Name: iaR10016 Date: 10/17/2001

      JDK : JDK1.4.0-beta-b83
      JCK : JCK1.4-b11
      Platform[s] : RedHat Linux 7.1, Windows NT 4.0
      switch/Mode : plugin with Netscape 6.1
                       (The test passes when running under plugin with Netscape 4.76.
                       The test passes when running in default JDK mode and under appletviewer)
      JCK test owner : http://javaweb.eng/jck/usr/owners.jto
      Failing Test : api/java_lang/Class/index.html#Reflect [Class0919]

      JavaTM 2 Platform Std. Ed. v1.4.0 Specification (build 83) reads about Class.getResourceAsStream(String) method:
      ...
      public InputStream getResourceAsStream(String name)
            Finds a resource with a given name.
      ...
            Parameters: name - name of the desired resource
            Returns: a java.io.InputStream object.
            Throws: NullPointerException - if name is null.
      ...

      But Class.getResourceAsStream(null) does not throw NullPointerException in JDK1.4.0-beta-b83
      when running under plugin with Netscape 6.1.

      The following test example demonstrates the bug.
      Please, compile test.java under RedHat Linux 7.1 and then open test.html using
      Netscape Navigator 6.1.

      ---------------- test.java --------------------
      import java.applet.*;
      public class test extends Applet {
          public static void main(String argv[]) { (new test()).init(); }
          public void init() {
              try {
                  this.getClass().getResourceAsStream(null);
                  System.out.println(" Failed: NullPointerException expected");
              } catch (NullPointerException npe) {
                  System.out.println( "Passed: OK" );
              }
          }
      }
      ---------------- test.html --------------------
      <html> <EMBED type=application/x-java-applet code=test> </html>
      ---------------------------------------------------

      Sample output is:
      ...
      Failed: NullPointerException expected
      ...

      Test source location:
      =====================
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/api/java_lang/Class/ReflectTests.java

      jtr file location:
      ==================
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_kde2plugin_ns6.1_linux-24/workDir/api/java_lang/Class/index_Reflect.jtr

      Test output:
      =============
      ...
      Class0919: Failed. NullPointerException expected
      ...
      result: Failed. tests: 52; passed: 51; failed: 1; first test case failure: Class0919

      Specific Machine Info:
      =====================
      Hostname: Linux-14
      OS: RedHat Linux 7.1

      Hostname: Linux-21
      OS: Windows NT 4.0

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

            mcolburnsunw Michael Colburn (Inactive)
            irasunw Ira Ira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: