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

Invalid compiler error - scoping rules

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      x86
    • OS:
      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

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: