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

NullPointerException in java.tools.tree.NewInstanceExpression.code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      sparc
    • OS:
      generic
    • Verification:
      Not verified

      Description

      Using the JDK prebeta, I tried compiling a .java file and received the
      following error:

      blegga% javac test.java
      java.lang.NullPointerException
              at java.tools.tree.NewInstanceExpression.code(NewInstanceExpression.java)
              at java.tools.tree.ExpressionStatement.code(ExpressionStatement.java)
              at java.tools.javac.SourceField.code(SourceField.java)
              at java.tools.javac.SourceField.code(SourceField.java)
              at java.tools.javac.SourceClass.compileClass(SourceClass.java)
              at java.tools.javac.SourceClass.compile(SourceClass.java)
              at java.tools.javac.Main.compile(Main.java)
              at java.tools.javac.Main.main(Main.java)
      /tmp/test//test.java:1: Class test already defined in test.java.
      class test
            ^
      /tmp/test//test.java:19: Class t not found in new.
              new t();
              ^
      error: An exception has occurred in the compiler, please file a bug report (###@###.###).
      3 errors

      Here is a uuencoded tar file of the two files that cause the problem.
      If the date of t.class is more recent than test.java then I do not get
      this problem.

      begin 664 javac-exception.tar
      M="YC;&%S<P
      M
      M # Q,# V-C0 ,# V,S8U-@ P,# P,#$R # P,# P,# P-C S
      M # U-C8W,#,P-# P # P,3,P-#$ ,
      M
      M !U<W1A<@ P,'1H97)O
      M;@ <W1A9F8
      M P,# P,# P # P,# P,#
      M
      M
      M
      M #*_KJ^ , +0 <!P ;!P 4!P 8"0 # @* (
      M!PD P )# 5 !H, !8 $ P %P 0 0 !8@$ 6$! ,H*4D! U#;VYS=&%N
      M=%9A;'5E 0 *17AC97!T:6]N<P$ #TQI;F5.=6UB97)486)L90$ 4D! I3
      M;W5R8V5&:6QE 0 .3&]C86Q687)I86)L97,! 1#;V1E 0 0:F%V82]L86YG
      M+T]B:F5C= $ !CQI;FET/@$ 7D! %X 0 != $ "71E<W0N:F%V80$ R@I
      M5@$ !'1E<W0 # ( " %P 0 " 6 ! # $ "P , $
      M$P !H 0 @.L 0 / !@ ! " H &@ ! !, D
      M ( 0 @JL@ $M0 &L0 $ #P H @ T !P + $ %0 : $
      M$P !T 0 ! !2JW 6Q 0 / !@ ! 0 ! !$ " !D
      M
      M
      M '1E<W0N:F%V80
      M
      M P
      M,3 P-C8T # P-C,V-38 ,# P,# Q,@ P,# P,# P,#(W-P P-C T,S(R-S,T
      M,@ P,#$S-# R #
      M
      M =7-T87( ,#!T:&5R;VX
      M '-T869F
      M ,# P,# P, P,# P,# P
      M
      M
      M
      M 8VQA<W,@=&5S= I["B @("!I;G0@>#L*(" @('-T871I8R!I;G0@
      M>3L*"B @("!P=6)L:6,@:6YT(&$H*0H@(" @>PH)<F5T=7)N(# ["B @("!]
      M"@H@(" @=F]I9"!B*"D*(" @('L*"7@@/2!Y.PH@(" @?0H*(" @('!U8FQI
      M8R!S=&%T:6,@=F]I9 H@(" @;6%I;BA3=')I;F<@87)G=EM=*0H@(" @>PH)
      M;F5W('0H*3L*(" @('T*?0H
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      M
      ,
       
      end

      The file test.java used to contain two classes, 'test' and 't'. I removed
      the class 't' from test.java but by accident continued to refer to a class
      of type 't'. I'm guessing this caused javac to read t.class and note that
      the source file was test.java and tried to compile it again.

      -Theron, 24 Oct 95

        Attachments

          Activity

            People

            Assignee:
            fyellinsunw Frank Yellin (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: