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

Invalid compiler error on private method and generics

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 7
    • tools
    • x86
    • linux, linux_ubuntu, windows_xp

      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 :
      Existing code compiles fine in Java 6, doesn't compile in Java 7

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

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

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      privateMethod() has private access in JavacBug

      REPRODUCIBILITY :
      This bug can be reproduced always.

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

      public class JavacBug
      {
      public static <T extends JavacBug> void doIt (T t)
      {
      t.privateMethod ();
      }

      private void privateMethod () {}
      }

      ---------- END SOURCE ----------

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: