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

generified code fails to compile

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_7

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: