8325189: Enable this-escape javac warning in java.base

Reviewed-by: alanb, erikj, naoto, smarks, ihse, joehw, lancea, weijun
This commit is contained in:
Joe Darcy 2024-02-07 20:05:11 +00:00
parent 299a8ee68d
commit fbd15b2087
93 changed files with 151 additions and 2 deletions

View file

@ -159,6 +159,7 @@ public class TreeSet<E> extends AbstractSet<E>
* not {@link Comparable}, or are not mutually comparable
* @throws NullPointerException if the specified collection is null
*/
@SuppressWarnings("this-escape")
public TreeSet(Collection<? extends E> c) {
this();
addAll(c);
@ -171,6 +172,7 @@ public class TreeSet<E> extends AbstractSet<E>
* @param s sorted set whose elements will comprise the new set
* @throws NullPointerException if the specified sorted set is null
*/
@SuppressWarnings("this-escape")
public TreeSet(SortedSet<E> s) {
this(s.comparator());
addAll(s);