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

examples in LinkedHashMap and LinkedHashSet class doc use raw types

    Details

    • Type: Bug
    • Status: Open
    • Priority: P5
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • 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

          Activity

            People

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

              Dates

              • Created:
                Updated: