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

api/java_util/EnumMap compilation failures

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 7
    • 7
    • tools
    • None
    • b55
    • 7
    • generic
    • generic

      The tests on java.util.EnumMap use the following code pattern:
      ---------------------------------------------------------
          Object [] array = {
              Suit.CLUBS, null,
              Suit.DIAMONDS, "val1",
              Suit.HEARTS, "val2",
              Suit.SPADES, new Integer(1)
          };
          ...
          EnumMap map = new EnumMap(Suit.class);
          ...
          for (int j = 0; j < i; j += 2) {
              map.put(array[j], array[j + 1]); // *
          }
      ---------------------------------------------------------

      The line marked (*) cause compilation error since JDK7 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
      ---------------------------------------------------------

            Unassigned Unassigned
            dmiltsov Dmitry Miltsov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: