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

examples in LinkedHashMap and LinkedHashSet class doc use raw types

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P5
    • Resolution: Fixed
    • None
    • 16
    • core-libs
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: