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

cross-compiling to 1.4 using -source 1.5 crashes javac

    XMLWordPrintable

Details

    • generic, x86
    • solaris_8, windows_2000

    Description

      Subject: NullPointerException thown by javac in J2SE 1.5.0-b32
      Date: Thu, 08 Jan 2004 05:29:10 +0000
      From: <###@###.###>
      To: ###@###.###

      CAP Bug Submission Form
      Please fill out the following as completely as possible and email to
      ###@###.###. Please also include any source code or class files
      required to reproduce the bug.


      Your Name: Mark Mahieu



      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 the
       Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi)
      after ch
      ecking the Bug Parade for duplicates. Include your program and the
      following dia
      gnostic 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)

      Attachments

        Issue Links

          Activity

            People

              gafter Neal Gafter
              gafter Neal Gafter
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: