Skip to content
Permalink
Browse files
8157729: examples in LinkedHashMap and LinkedHashSet class doc use ra…
…w types

Reviewed-by: darcy, naoto, lancea
  • Loading branch information
Stuart Marks committed Sep 9, 2020
1 parent 26c7218 commit 30fa8d5d341fbf64e84da13a05c8048afba25196
Showing with 10 additions and 10 deletions.
  1. +5 −5 src/java.base/share/classes/java/util/LinkedHashMap.java
  2. +5 −5 src/java.base/share/classes/java/util/LinkedHashSet.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -47,12 +47,12 @@
* without incurring the increased cost associated with {@link TreeMap}. It
* can be used to produce a copy of a map that has the same order as the
* original, regardless of the original map's implementation:
* <pre>
* void foo(Map m) {
* Map copy = new LinkedHashMap(m);
* <pre>{@code
* void foo(Map<String, Integer> m) {
* Map<String, Integer> copy = new LinkedHashMap<>(m);
* ...
* }
* </pre>
* }</pre>
* This technique is particularly useful if a module takes a map on input,
* copies it, and later returns results whose order is determined by that of
* the copy. (Clients generally appreciate having things returned in the same
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,12 +42,12 @@
* increased cost associated with {@link TreeSet}. It can be used to
* produce a copy of a set that has the same order as the original, regardless
* of the original set's implementation:
* <pre>
* void foo(Set s) {
* Set copy = new LinkedHashSet(s);
* <pre>{@code
* void foo(Set<String> s) {
* Set<String> copy = new LinkedHashSet<>(s);
* ...
* }
* </pre>
* }</pre>
* This technique is particularly useful if a module takes a set on input,
* copies it, and later returns results whose order is determined by that of
* the copy. (Clients generally appreciate having things returned in the same

2 comments on commit 30fa8d5

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot replied Sep 9, 2020

Review

Issues

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot replied Oct 14, 2020

Review

Issues

Please sign in to comment.