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

NPE exception thrown when cross-compile a class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • tools
    • x86
    • windows_2000


      ###@###.### 2004-01-08

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

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

      Operating System Configuration Information (be specific):
        Windows 2000 Professional (Service Pack 2)
        RedHat 9.0

      Hardware Configuration Information (be specific):
        AMD Athlon 600Mhz, 384MB, TNT2 32MB AGP graphics

      Bug Description:
        Attempting to cross-compile a class as described in the javac tool docs
        for 1.4.2, using options
         -source 1.5
         -target 1.4
         -bootclasspath <location of the rt.jar from a 1.4 SDK installation>
         -extdirs ""
        causes javac to throw a NullPointerException

      Steps to Reproduce (be specific):
        1) Create Dummy.java with the following content:
       
            class Dummy { }
       
        2) Compile Dummy.java eg:

          javac -source 1.5 -target 1.4 -bootclasspath
           c:\dev\tools\j2sdk1.4.2\jre\lib\rt.jar -extdirs "" Dummy.java

        3) Watch the stack trace scroll by :

        An exception has occurred in the compiler (1.5.0-beta). Please file a
        bug at thw Java Developer Connection
        (http://java.sun.com/cgi-bin/bugreport.cgi)

        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.javac.comp.Lower.visitApply(Lower.java:2209)
              at com.sun.tools.javac.tree.Tree$Apply.accept(Tree.java:814)
              at com.sun.tools.javac.comp.Lower.translate(Lower.java:1731)
              at
      com.sun.tools.javac.tree.TreeTranslator.visitExec(TreeTranslator.java:224)
              at com.sun.tools.javac.tree.Tree$Exec.accept(Tree.java:731)
              at com.sun.tools.javac.comp.Lower.translate(Lower.java:1731)
              at
      com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:51)
              at
      com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:142)
              at com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:2705)
              at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:537)
              at com.sun.tools.javac.comp.Lower.translate(Lower.java:1731)
              at
      com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(TreeTranslator.java:126)
              at
      com.sun.tools.javac.comp.Lower.visitMethodDefInternal(Lower.java:2057)
              at com.sun.tools.javac.comp.Lower.visitMethodDef(Lower.java:1976)
              at com.sun.tools.javac.tree.Tree$MethodDef.accept(Tree.java:479)
              at com.sun.tools.javac.comp.Lower.translate(Lower.java:1731)
              at com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:1804)
              at com.sun.tools.javac.tree.Tree$ClassDef.accept(Tree.java:435)
              at com.sun.tools.javac.comp.Lower.translate(Lower.java:1731)
              at com.sun.tools.javac.comp.Lower.translate(Lower.java:1751)
              at
      com.sun.tools.javac.comp.Lower.translateTopLevelClass(Lower.java:2813)
              at
      com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:452)
              at com.sun.tools.javac.main.Main.compile(Main.java:584)
              at com.sun.tools.javac.main.Main.compile(Main.java:536)
              at com.sun.tools.javac.Main.compile(Main.java:41)
              at com.sun.tools.javac.Main.main(Main.java:32)


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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: