mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8157729: examples in LinkedHashMap and LinkedHashSet class doc use raw types
Reviewed-by: darcy, naoto, lancea
This commit is contained in:
parent
26c7218ab9
commit
30fa8d5d34
2 changed files with 10 additions and 10 deletions
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -47,12 +47,12 @@ import java.io.IOException;
|
||||||
* without incurring the increased cost associated with {@link TreeMap}. It
|
* 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
|
* 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:
|
* original, regardless of the original map's implementation:
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* void foo(Map m) {
|
* void foo(Map<String, Integer> m) {
|
||||||
* Map copy = new LinkedHashMap(m);
|
* Map<String, Integer> copy = new LinkedHashMap<>(m);
|
||||||
* ...
|
* ...
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* }</pre>
|
||||||
* This technique is particularly useful if a module takes a map on input,
|
* 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
|
* copies it, and later returns results whose order is determined by that of
|
||||||
* the copy. (Clients generally appreciate having things returned in the same
|
* 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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -42,12 +42,12 @@ package java.util;
|
||||||
* increased cost associated with {@link TreeSet}. It can be used to
|
* 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
|
* produce a copy of a set that has the same order as the original, regardless
|
||||||
* of the original set's implementation:
|
* of the original set's implementation:
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* void foo(Set s) {
|
* void foo(Set<String> s) {
|
||||||
* Set copy = new LinkedHashSet(s);
|
* Set<String> copy = new LinkedHashSet<>(s);
|
||||||
* ...
|
* ...
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* }</pre>
|
||||||
* This technique is particularly useful if a module takes a set on input,
|
* 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
|
* copies it, and later returns results whose order is determined by that of
|
||||||
* the copy. (Clients generally appreciate having things returned in the same
|
* the copy. (Clients generally appreciate having things returned in the same
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue