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

CompilerError from ClassDefinition.addReference

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.6
    • tools
    • generic, sparc
    • generic, solaris_2.5.1

      See comments

      Name: skT88420 Date: 06/03/99


      /*Compiling this code product error
      Produced on OS/2's Java JDK 1.1.6
      */

      public class BugInSwitch
      {
         public final int MODE_1=1; //!! NOT static
         public final int MODE_2=2; //!! NOT static

         public BugInSwitch(int mode)
         {
          switch(mode)
          {
          case MODE_1: break;
          case MODE_2: break;
          }
         }
      }
      /*
      javac BugInSwitch.java

      sun.tools.java.CompilerError: addReference BugInSwitch this
              at sun.tools.java.ClassDefinition.addReference(Compiled Code)
              at sun.tools.java.ClassDefinition.getReference(Compiled Code)
              at sun.tools.tree.Context.noteReference(Compiled Code)
              at sun.tools.tree.Context.makeReference(Compiled Code)
              at sun.tools.tree.ThisExpression.checkValue(Compiled Code)
              at sun.tools.tree.Expression.checkAmbigName(Compiled Code)
              at sun.tools.tree.FieldExpression.checkCommon(Compiled Code)
              at sun.tools.tree.FieldExpression.checkValue(Compiled Code)
              at sun.tools.tree.IdentifierExpression.checkValue(Compiled Code)
              at sun.tools.tree.CaseStatement.check(Compiled Code)
              at sun.tools.tree.SwitchStatement.check(Compiled Code)
              at sun.tools.tree.Statement.checkBlockStatement(Compiled Code)
              at sun.tools.tree.CompoundStatement.check(Compiled Code)
              at sun.tools.tree.Statement.checkMethod(Compiled Code)
              at sun.tools.javac.SourceField.check(Compiled Code)
              at sun.tools.javac.SourceClass.checkFields(Compiled Code)
              at sun.tools.javac.SourceClass.checkInternal(Compiled Code)
              at sun.tools.javac.SourceClass.check(Compiled Code)
              at sun.tools.javac.Main.compile(Compiled Code)
              at sun.tools.javac.Main.main(Compiled Code)

      error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
      1 error

      */
      (Review ID: 83902)
      ======================================================================

      Name: skT88420 Date: 06/04/99


      On the SGI O2, under Irix 6.3, I get the following when trying to compile a Java class at the command line:

      javac TintOperator.java
      sun.tools.java.CompilerError: addReference VoxelMincer.TintOperator this
              at sun.tools.java.ClassDefinition.addReference(ClassDefinition.java:1077)
              at sun.tools.java.ClassDefinition.getReference(ClassDefinition.java:1072)
              at sun.tools.tree.Context.noteReference(Context.java:308)
              at sun.tools.tree.Context.makeReference(Context.java:329)
              at sun.tools.tree.ThisExpression.checkValue(ThisExpression.java:76)
              at sun.tools.tree.Expression.checkAmbigName(Expression.java:210)
              at sun.tools.tree.FieldExpression.checkCommon(FieldExpression.java:135)
              at sun.tools.tree.FieldExpression.checkValue(FieldExpression.java:111)
              at sun.tools.tree.IdentifierExpression.checkValue(IdentifierExpression.java:224)
              at sun.tools.tree.CaseStatement.check(CaseStatement.java:46)
              at sun.tools.tree.SwitchStatement.check(SwitchStatement.java:66)
              at sun.tools.tree.Statement.checkBlockStatement(Statement.java:120)
              at sun.tools.tree.CompoundStatement.check(CompoundStatement.java:70)
              at sun.tools.tree.Statement.checkMethod(Statement.java:98)
              at sun.tools.javac.SourceField.check(SourceField.java:412)
              at sun.tools.javac.SourceClass.checkFields(SourceClass.java:852)
              at sun.tools.javac.SourceClass.checkInternal(SourceClass.java:615)
              at sun.tools.javac.SourceClass.check(SourceClass.java:566)
              at sun.tools.javac.Main.compile(Main.java:349)
              at sun.tools.javac.Main.main(Main.java:521)
      error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
      (Review ID: 83963)
      ======================================================================

            tturnidgsunw Todd Turnidge (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: