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

cannot access member of raw type when erasure change overriding into overloading

    Details

    • Subcomponent:
    • Introduced In Build:
      b55
    • Introduced In Version:
      7
    • Resolved In Build:
      b68
    • CPU:
      generic, unknown
    • OS:
      generic
    • Verification:
      Verified

      Description

      Please see the following mini test (JCK tests use the similar code pattern):
      ---------------------------------------------------------
      import java.util.EnumMap;

      enum Suit {
          CLUBS, DIAMONDS;
      }

      public class minitest {
          static Object [] array = {
              Suit.CLUBS, "value1",
              Suit.DIAMONDS, "value2"
          };

          public static void main(String[] args) {
              EnumMap map = new EnumMap(Suit.class);
              map.put(array[0], array[1]);
          }
      }
      ---------------------------------------------------------

      It compiles on JDK b54, and fails on b55 with the output:
      ---------------------------------------------------------
      minitest.java:15: cannot find symbol
              map.put(array[0], array[1]);
                 ^
        symbol: method put(java.lang.Object,java.lang.Object)
        location: class java.util.EnumMap
      ---------------------------------------------------------

      Could you please clarify is this behavior correct ?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mcimadamore Maurizio Cimadamore
                Reporter:
                mcimadamore Maurizio Cimadamore
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: