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

Compiler crashes when using two final constants inside of a switch statement

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.2
    • tools
    • None
    • sparc
    • solaris_2.5.1



      Name: tb29552 Date: 06/20/97


      1)
          just comiling : javac bug.java
      ----------------------------------------------------
      2)
      class bug {

      final int caNull = 0 ;
      final char endOfLine = '\0' ;


      bug( String line ){
        int s = 0 ;
        char c = '\0';
           switch( s ){
             case caNull :
               c = endOfLine ;
             break ;
           }
           

        return ;
        
      }

      }

      -------------------------------------------------------------
      3)sun.tools.java.CompilerError: addReference bug this
              at sun.tools.java.ClassDefinition.addReference(ClassDefinition.java)
              at sun.tools.java.ClassDefinition.getReference(ClassDefinition.java)
              at sun.tools.tree.Context.noteReference(Context.java)
              at sun.tools.tree.Context.makeReference(Context.java)
              at sun.tools.tree.ThisExpression.checkValue(ThisExpression.java)
              at sun.tools.tree.Expression.checkAmbigName(Expression.java)
              at sun.tools.tree.FieldExpression.checkCommon(FieldExpression.java)
              at sun.tools.tree.FieldExpression.checkValue(FieldExpression.java)
              at sun.tools.tree.IdentifierExpression.checkValue(IdentifierExpression.java)
              at sun.tools.tree.AssignExpression.checkValue(AssignExpression.java)
              at sun.tools.tree.BinaryAssignExpression.check(BinaryAssignExpression.java)
              at sun.tools.tree.ExpressionStatement.check(ExpressionStatement.java)
              at sun.tools.tree.Statement.checkBlockStatement(Statement.java)
              at sun.tools.tree.SwitchStatement.check(SwitchStatement.java)
              at sun.tools.tree.Statement.checkBlockStatement(Statement.java)
              at sun.tools.tree.CompoundStatement.check(CompoundStatement.java)
              at sun.tools.tree.Statement.checkMethod(Statement.java)
              at sun.tools.javac.SourceField.check(SourceField.java)
              at sun.tools.javac.SourceClass.checkFields(SourceClass.java)
              at sun.tools.javac.SourceClass.checkInternal(SourceClass.java)
              at sun.tools.javac.SourceClass.check(SourceClass.java)
              at sun.tools.javac.Main.compile(Main.java)
              at sun.tools.javac.Main.main(Main.java)
      error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
      1 error
      -------------------------------------------------------
      4) sorry, no further trace informations
      -------------------------------------------------------
      5)
          I'm using a Sparc 10, but the same thing happens
          on an 1.1.2 implementation on IRIX.
      company - DESY Hamburg , email - ###@###.###
      ======================================================================

            tturnidgsunw Todd Turnidge (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: