javac compiler error "sun.tools.java.CompilerError: addReference"

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.2.2
    • Component/s: tools
    • x86
    • linux



      Name: skT45625 Date: 04/13/2000


      java version "1.2.2"
      Classic VM (build 1.2.2-L, green threads, nojit)


      In the file PortReport.java, I have:

      import java.util.*;

      public class PortReport {
        public static void main(String[] args) {
          Portfolio port = new Portfolio("foobar");
        }
      }

      In the file Portfolio.java, I have:

      import java.util.*;


      public class Portfolio {
        String name;
        public Portfolio(String buf){
          TokenBuffer tbuf = new TokenBuffer();
          switch (1) {
          case tbuf.T_NAME:
            name = "figi";
          }
        }
        String getName(){ return name; }
        class TokenBuffer { final int T_NAME = 3; }
      }

      Both files reside in the same directory. To compile, I run "javac
      PortReport.java" from the command line and get the following back:

      sun.tools.java.CompilerError: addReference Portfolio this
              at
      sun.tools.java.ClassDefinition.addReference(ClassDefinition.java:1892)
              at
      sun.tools.java.ClassDefinition.getReference(ClassDefinition.java:1887)
              at sun.tools.tree.Context.noteReference(Context.java:332)
              at sun.tools.tree.Context.makeReference(Context.java:353)
              at sun.tools.tree.ThisExpression.checkValue(ThisExpression.java:82)
              at sun.tools.tree.Expression.checkAmbigName(Expression.java:250)
              at sun.tools.tree.FieldExpression.checkCommon(FieldExpression.java:497)
              at sun.tools.tree.FieldExpression.checkValue(FieldExpression.java:216)
              at
      sun.tools.tree.IdentifierExpression.checkLHS(IdentifierExpression.java:238)
              at sun.tools.tree.AssignExpression.checkValue(AssignExpression.java:38)
              at
      sun.tools.tree.BinaryAssignExpression.check(BinaryAssignExpression.java:51)
              at sun.tools.tree.ExpressionStatement.check(ExpressionStatement.java:35)
              at sun.tools.tree.Statement.checkBlockStatement(Statement.java:153)
              at sun.tools.tree.SwitchStatement.check(SwitchStatement.java:112)
              at sun.tools.tree.Statement.checkBlockStatement(Statement.java:153)
              at sun.tools.tree.CompoundStatement.check(CompoundStatement.java:61)
              at sun.tools.tree.Statement.checkMethod(Statement.java:88)
              at sun.tools.javac.SourceMember.check(SourceMember.java:535)
              at sun.tools.javac.SourceClass.checkMembers(SourceClass.java:993)
              at sun.tools.javac.SourceClass.checkInternal(SourceClass.java:608)
              at sun.tools.javac.SourceClass.check(SourceClass.java:507)
              at sun.tools.javac.Main.compile(Main.java:546)
              at sun.tools.javac.Main.main(Main.java:729)
      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: 103673)
      ======================================================================

            Assignee:
            Iris Clark
            Reporter:
            Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: