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

examples in LinkedHashMap and LinkedHashSet class doc use raw types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 16
    • Component/s: core-libs
    • Labels:
      None

      Description

      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);
              // ...
          }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: