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

Invalid compiler error - scoping rules

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • None
    • 7
    • tools
    • x86
    • linux

    Description

      FULL PRODUCT VERSION :
      java version "1.7.0-ea"
      Java(TM) SE Runtime Environment (build 1.7.0-ea-b130)
      Java HotSpot(TM) Server VM (build 21.0-b02, mixed mode)


      A DESCRIPTION OF THE PROBLEM :
      Code that previously compiled fine under JDK 1.6 no longer compiles

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Try to compile the given code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The code should compile
      ACTUAL -
      The code doesn't compile

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      cannot find symbol

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package bugs;

      // Note explicit import (for this example we import from the same package, but it could be a different package)
      import bugs.Type;

      public class JavacBug extends javax.swing.JFrame
      {
      // Compiler thinks I'm talking about java.awt.Window.Type
      private Type t = Type.VALUE;
      }

      enum Type
      {
      VALUE
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Rename affected class

      Attachments

        Issue Links

          Activity

            People

              mcimadamore Maurizio Cimadamore
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: