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

generified code fails to compile

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7
    • tools
    • x86
    • windows_7

      FULL PRODUCT VERSION :
      $ java -version
      java version "1.7.0-ea"
      Java(TM) SE Runtime Environment (build 1.7.0-ea-b119)
      Java HotSpot(TM) 64-Bit Server VM (build 20.0-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7600]

      A DESCRIPTION OF THE PROBLEM :
      The attached source code fails to compile


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile said class fails

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It should compile correctly

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Wtf.java:[7,28] foo has private access in Wtf

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Wtf {
          private Object foo;
          
          public <T extends Wtf> void test(T t) {
              System.out.println(t.foo);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      make the field package private

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: