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

examples in LinkedHashMap and LinkedHashSet class doc use raw types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 16
    • None
    • core-libs
    • None

      The LinkedHashMap class doc contains the following example:

           void foo(Map m) {
               Map copy = new LinkedHashMap(m);
               ...
           }

      This uses raw types. It should use upgraded to use generics. Probably something like

          <K,V> void foo(Map<K,V> m) {
              Map<K,V> copy = new LinkedHashMap<>(m);
              // ...
          }

            smarks Stuart Marks
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: