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

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

    XMLWordPrintable

Details

    • b55
    • 7
    • b68
    • generic, unknown
    • generic
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: