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

JSR 199: DiagnosticCollector.report(null) should throw NPE

XMLWordPrintable

    • b03
    • generic
    • generic
    • Verified

      DiganosticCollector.report(null) should throw NPE
      <testcase>
      import javax.tools.*;
      public class Foo {
          public static void main(String... arg) throws Throwable {
              DiagnosticCollector<JavaFileObject> dl
                      = new DiagnosticCollector<JavaFileObject>();
              dl.report(null);
              throw new Exception("Expected null pointer exception not thrown");
          }
      }
      </testcase>

      <output>
      bash-3.00$ java Foo
      Exception in thread "main" java.lang.Exception: Expected null pointer exception not thrown
              at Foo.main(Foo.java:7)
      </output>

      <java-version>
      bash-3.00$ java -version
      java version "1.6.0-rc"
      Java(TM) SE Runtime Environment (build 1.6.0-rc-b92)
      </java-version>

            ahe Peter Ahe
            savadhansunw Seetharama Avadhanam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: