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

sun.tools.java.CompilerError: codeConversion: 8, 13

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.6

      Description



      Name: skT88420 Date: 08/04/99


      SOURCE :
      --------

      public class CompileBug {

        private final int theBug = null;

        public CompileBug() {
          theBug = 0;
        }

        class Bar {
          Bar() {
            int i = theBug;
            System.out.println(theBug + " is the value is theBug and " + i + " is the value of i");
          }
        }

        public static void main(String args[]) {

              CompileBug cb = new CompileBug();
              CompileBug.Bar b = cb.new Bar();
       }
      }

      ERROR MESSAGE:
      --------------

      sun.tools.java.CompilerError: codeConversion: 8, 13
              at sun.tools.tree.Expression.codeConversion(Expression.java, Compiled Code)
              at sun.tools.tree.ConvertExpression.codeValue(ConvertExpression.java, Compiled Code)
              at sun.tools.tree.VarDeclarationStatement.code(VarDeclarationStatement.java, Compiled Code)
              at sun.tools.tree.DeclarationStatement.code(DeclarationStatement.java, Compiled Code)
              at sun.tools.tree.CompoundStatement.code(CompoundStatement.java, Compiled Code)
              at sun.tools.javac.SourceMember.code(SourceMember.java, Compiled Code)
              at sun.tools.javac.SourceMember.code(SourceMember.java, Compiled Code)
              at sun.tools.javac.SourceClass.compileClass(SourceClass.java, Compiled Code)
              at sun.tools.javac.SourceClass.compile(SourceClass.java, Compiled Code)
              at sun.tools.javac.Main.compile(Main.java, Compiled Code)
              at sun.tools.javac.Main.main(Main.java, Compiled Code)
      CompileBug.java:0: inner class CompileBug. Bar:CompileBug. Bar(CompileBug)@sun.tools.java.CompilerError: codeConversion: 8, 13
      public class CompileBug {
      ^
      CompileBug.java:3: Incompatible type for null. Can't convert null to int.
        private final int theBug = null;
                                   ^
      CompileBug.java:6: Can't assign a value to a final variable: theBug
          theBug = 0;
          ^
      3 errors

      VERSION:
      --------

      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, green threads, sunwjit)
      (Review ID: 93282)
      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            wmaddoxsunw William Maddox (Inactive)
            Reporter:
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: