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

NPE exception is thrown if there are any parameter annotations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • tools
    • apt
    • x86
    • windows_xp


      ###@###.### 2004-05-19

      J2SE Version (please include all output from java -version flag):
        java version "1.5.0-beta2"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b50)
        Java HotSpot(TM) Client VM (build 1.5.0-beta2-b50, mixed mode, sharing)

      Does this problem occur on J2SE 1.4 or 1.4.1 or 1.4.2? Yes / No (pick one)
        N/A

      Operating System Configuration Information (be specific):
        Windows XP

      Hardware Configuration Information (be specific):
        Dell Optiplex

      Bug Description:
        Running apt on sources using parameter annotations causes a NPE. This
        exception is thrown regardless of what annotation processor code is
        loaded and it is independant of whether you supply an annotation
        processor factory or not. Here is the stack-trace from the apt tool:

      An exception has occurred in the compiler (1.5.0-beta2). Please file a
      bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)
      after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.NullPointerException
              at com.sun.tools.apt.comp.Apt$AptTreeScanner.visitAnnotation(Apt.java:171)
              at com.sun.tools.javac.tree.Tree$Annotation.accept(Tree.java:1115)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:34)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:42)
              at com.sun.tools.javac.tree.TreeScanner.visitModifiers(TreeScanner.java:265)
              at com.sun.tools.javac.tree.Tree$Modifiers.accept(Tree.java:1126)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:34)
              at com.sun.tools.javac.tree.TreeScanner.visitVarDef(TreeScanner.java:77)
              at com.sun.tools.apt.comp.Apt$AptTreeScanner.visitVarDef(Apt.java:166)
              at com.sun.tools.javac.tree.Tree$VarDef.accept(Tree.java:511)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:34)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:42)
              at com.sun.tools.javac.tree.TreeScanner.visitMethodDef(TreeScanner.java:71)
              at com.sun.tools.apt.comp.Apt$AptTreeScanner.visitMethodDef(Apt.java:162)
              at com.sun.tools.javac.tree.Tree$MethodDef.accept(Tree.java:482)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:34)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:42)
              at com.sun.tools.javac.tree.TreeScanner.visitClassDef(TreeScanner.java:64)
              at com.sun.tools.apt.comp.Apt$AptTreeScanner.visitClassDef(Apt.java:156)
              at com.sun.tools.javac.tree.Tree$ClassDef.accept(Tree.java:438)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:34)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:42)
              at com.sun.tools.javac.tree.TreeScanner.visitTopLevel(TreeScanner.java:52)
              at com.sun.tools.apt.comp.Apt$AptTreeScanner.visitTopLevel(Apt.java:134)
              at com.sun.tools.javac.tree.Tree$TopLevel.accept(Tree.java:386)
              at com.sun.tools.apt.comp.Apt.main(Apt.java:182)
              at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:418)
              at com.sun.tools.apt.main.Main.compile(Main.java:939)
              at com.sun.tools.apt.main.Main.compile(Main.java:822)
              at com.sun.tools.apt.Main.compile(Main.java:41)
              at com.sun.tools.apt.Main.main(Main.java:32)
      Note: Some input files use unchecked or unsafe operations.
      Note: Recompile with -Xlint:unchecked for details.

      Test case:
      -------------------------
      public @interface MyAnn {
      }

      public interface Foo
      {
      public void doStuff(@MyAnn String arg);
      }

            sseligmasunw Scott Seligman (Inactive)
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: