8343478: Remove unnecessary @SuppressWarnings annotations (core-libs)

Reviewed-by: darcy, asemenyuk, joehw
This commit is contained in:
Archie Cobbs 2025-03-05 17:32:59 +00:00
parent 61d9ab9717
commit 661bd5bfe8
93 changed files with 121 additions and 211 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -198,7 +198,6 @@ class Bundle {
String[] cldrBundles = getCLDRPath().split(",");
// myMap contains resources for id.
@SuppressWarnings("unchecked")
Map<String, Object> myMap = new HashMap<>();
int index;
for (index = 0; index < cldrBundles.length; index++) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -1079,7 +1079,6 @@ class LDMLParseHandler extends AbstractLDMLHandler<Object> {
}
@Override
@SuppressWarnings("fallthrough")
public void endElement(String uri, String localName, String qName) throws SAXException {
assert qName.equals(currentContainer.getqName()) : "current=" + currentContainer.getqName() + ", param=" + qName;
switch (qName) {

View File

@ -681,7 +681,6 @@ public class File
if (isInvalid()) {
throw new MalformedURLException("Invalid file path");
}
@SuppressWarnings("deprecation")
var result = new URL("file", "", slashify(getAbsolutePath(), isDirectory()));
return result;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -340,7 +340,6 @@ public final class FileDescriptor {
*
* The caller closeable gets to call close0().
*/
@SuppressWarnings("try")
synchronized void closeAll(Closeable releaser) throws IOException {
if (!closed) {
closed = true;

View File

@ -353,7 +353,6 @@ public final class Package extends NamedPackage implements java.lang.reflect.Ann
*/
@CallerSensitive
@Deprecated(since="9")
@SuppressWarnings("deprecation")
public static Package getPackage(String name) {
ClassLoader l = ClassLoader.getClassLoader(Reflection.getCallerClass());
return l != null ? l.getPackage(name) : BootLoader.getDefinedPackage(name);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2025, 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
@ -142,7 +142,7 @@ class LambdaFormEditor {
return buf.toString();
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings("unchecked")
public LambdaForm get() {
if (cache instanceof LambdaForm lf) {
return lf;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2025, 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
@ -711,7 +711,7 @@ final class MemberName implements Member, Cloneable {
}
@Override
@SuppressWarnings({"deprecation", "removal"})
@SuppressWarnings("removal")
public int hashCode() {
// Avoid autoboxing getReferenceKind(), since this is used early and will force
// early initialization of Byte$ByteCache

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2025, 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
@ -110,7 +110,7 @@ final class MethodTypeForm {
return basicType;
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings("unchecked")
public MethodHandle cachedMethodHandle(int which) {
Object entry = methodHandles[which];
if (entry == null) {
@ -136,7 +136,7 @@ final class MethodTypeForm {
return mh;
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings("unchecked")
public LambdaForm cachedLambdaForm(int which) {
Object entry = lambdaForms[which];
if (entry == null) {
@ -167,7 +167,6 @@ final class MethodTypeForm {
* This MTF will stand for that type and all un-erased variations.
* Eagerly compute some basic properties of the type, common to all variations.
*/
@SuppressWarnings({"rawtypes", "unchecked"})
protected MethodTypeForm(MethodType erasedType) {
this.erasedType = erasedType;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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
@ -240,7 +240,7 @@ public final class Constructor<T> extends Executable {
* @since 1.5
*/
@Override
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings("unchecked")
public TypeVariable<Constructor<T>>[] getTypeParameters() {
if (getSignature() != null) {
return (TypeVariable<Constructor<T>>[])getGenericInfo().getTypeParameters();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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
@ -231,7 +231,7 @@ public final class Method extends Executable {
* @jls 8.4.4 Generic Methods
*/
@Override
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings("unchecked")
public TypeVariable<Method>[] getTypeParameters() {
if (getGenericSignature() != null)
return (TypeVariable<Method>[])getGenericInfo().getTypeParameters();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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
@ -202,7 +202,6 @@ final class ProxyGenerator {
* @param interfaces proxy interfaces
* @param accessFlags access flags of the proxy class
*/
@SuppressWarnings("removal")
static byte[] generateProxyClass(ClassLoader loader,
final String name,
List<Class<?>> interfaces,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -652,7 +652,6 @@ public interface ChronoLocalDate
* @param localTime the local time to use, not null
* @return the local date-time formed from this date and the specified time, not null
*/
@SuppressWarnings("unchecked")
default ChronoLocalDateTime<?> atTime(LocalTime localTime) {
return ChronoLocalDateTimeImpl.of(this, localTime);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -269,7 +269,6 @@ final class ChronoLocalDateTimeImpl<D extends ChronoLocalDate>
}
//-----------------------------------------------------------------------
@SuppressWarnings("unchecked")
@Override
public ChronoLocalDateTimeImpl<D> with(TemporalAdjuster adjuster) {
if (adjuster instanceof ChronoLocalDate) {

View File

@ -1126,7 +1126,7 @@ public final class Arrays {
* off is the offset to generate corresponding low, high in src
* To be removed in a future release.
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("unchecked")
private static void mergeSort(Object[] src,
Object[] dest,
int low,

View File

@ -3363,7 +3363,6 @@ public final class Collections {
@SuppressWarnings("serial") // Conditionally serializable
final Collection<E> c;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Class<E> type;
@SuppressWarnings("unchecked")
@ -3926,10 +3925,8 @@ public final class Collections {
@SuppressWarnings("serial") // Conditionally serializable
private final Map<K, V> m;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Class<K> keyType;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Class<V> valueType;
private void typeCheck(Object key, Object value) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009 Google Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -309,7 +309,7 @@ class ComparableTimSort {
* @return the length of the run beginning at the specified position in
* the specified array
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("unchecked")
private static int countRunAndMakeAscending(Object[] a, int lo, int hi) {
assert lo < hi;
int runHi = lo + 1;
@ -648,7 +648,7 @@ class ComparableTimSort {
* (must be aBase + aLen)
* @param len2 length of second run to be merged (must be > 0)
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("unchecked")
private void mergeLo(int base1, int len1, int base2, int len2) {
assert len1 > 0 && len2 > 0 && base1 + len1 == base2;
@ -765,7 +765,7 @@ class ComparableTimSort {
* (must be aBase + aLen)
* @param len2 length of second run to be merged (must be > 0)
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("unchecked")
private void mergeHi(int base1, int len1, int base2, int len2) {
assert len1 > 0 && len2 > 0 && base1 + len1 == base2;
@ -895,7 +895,7 @@ class ComparableTimSort {
else
newSize = Math.min(newSize, a.length >>> 1);
@SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"})
@SuppressWarnings("UnnecessaryLocalVariable")
Object[] newArray = new Object[newSize];
tmp = newArray;
tmpLen = newSize;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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
@ -365,7 +365,7 @@ public class HashMap<K,V> extends AbstractMap<K,V>
* Returns k.compareTo(x) if x matches kc (k's screened comparable
* class), else 0.
*/
@SuppressWarnings({"rawtypes","unchecked"}) // for cast to Comparable
@SuppressWarnings("unchecked") // for cast to Comparable
static int compareComparables(Class<?> kc, Object k, Object x) {
return (x == null || x.getClass() != kc ? 0 :
((Comparable)k).compareTo(x));

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, 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
@ -226,7 +226,6 @@ public class LinkedHashSet<E>
return new LinkedHashSet<>(HashMap.calculateHashMapCapacity(numElements));
}
@SuppressWarnings("unchecked")
LinkedHashMap<E, Object> map() {
return (LinkedHashMap<E, Object>) map;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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
@ -501,7 +501,7 @@ public interface List<E> extends SequencedCollection<E> {
* contract
* @since 1.8
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("unchecked")
default void sort(Comparator<? super E> c) {
Object[] a = this.toArray();
Arrays.sort(a, (Comparator) c);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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
@ -1658,7 +1658,6 @@ public interface Map<K, V> {
* @since 9
*/
@SafeVarargs
@SuppressWarnings("varargs")
static <K, V> Map<K, V> ofEntries(Entry<? extends K, ? extends V>... entries) {
if (entries.length == 0) { // implicit null check of entries array
@SuppressWarnings("unchecked")

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2025, 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
@ -84,7 +84,6 @@ public interface PrimitiveIterator<T, T_CONS> extends Iterator<T> {
* @param action The action to be performed for each element
* @throws NullPointerException if the specified action is null
*/
@SuppressWarnings("overloads")
void forEachRemaining(T_CONS action);
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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
@ -163,7 +163,6 @@ public class PropertyResourceBundle extends ResourceBundle {
* {@code java.util.PropertyResourceBundle.encoding} is set to "UTF-8"
* and {@code stream} contains an unmappable UTF-8 byte sequence.
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public PropertyResourceBundle (InputStream stream) throws IOException {
this(new InputStreamReader(stream,
"ISO-8859-1".equals(encoding) ?

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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
@ -3511,7 +3511,6 @@ public abstract class ResourceBundle {
*/
static ResourceBundle newResourceBundle(Class<? extends ResourceBundle> bundleClass) {
try {
@SuppressWarnings("unchecked")
Constructor<? extends ResourceBundle> ctor =
bundleClass.getConstructor();
if (!Modifier.isPublic(ctor.getModifiers())) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, 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
@ -161,7 +161,6 @@ class ReverseOrderDequeView<E> implements Deque<E> {
return ArraysSupport.reverse(base.toArray());
}
@SuppressWarnings("unchecked")
public <T> T[] toArray(T[] a) {
return ArraysSupport.toArrayReversed(base, a);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, 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
@ -286,7 +286,6 @@ class ReverseOrderListView<E> implements List<E> {
return ArraysSupport.reverse(base.toArray());
}
@SuppressWarnings("unchecked")
public <T> T[] toArray(T[] a) {
return ArraysSupport.toArrayReversed(base, a);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, 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
@ -314,7 +314,6 @@ class ReverseOrderSortedMapView<K, V> extends AbstractMap<K, V> implements Sorte
final K head; // head key, or negative infinity if null
final K tail; // tail key, or positive infinity if null
@SuppressWarnings("unchecked")
Submap(K head, K tail) {
this.head = head;
this.tail = tail;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, 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
@ -170,7 +170,6 @@ class ReverseOrderSortedSetView<E> implements SortedSet<E> {
return ArraysSupport.reverse(base.toArray());
}
@SuppressWarnings("unchecked")
public <T> T[] toArray(T[] a) {
return ArraysSupport.toArrayReversed(base, a);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2025, 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
@ -726,7 +726,7 @@ public final class ServiceLoader<S>
@Override
public boolean equals(Object ob) {
return ob instanceof @SuppressWarnings("unchecked")ProviderImpl<?> that
return ob instanceof ProviderImpl<?> that
&& this.service == that.service
&& this.type == that.type;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2025, 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
@ -628,7 +628,6 @@ public interface Spliterator<T> {
* upon entry to this method, else {@code true}.
* @throws NullPointerException if the specified action is null
*/
@SuppressWarnings("overloads")
boolean tryAdvance(T_CONS action);
/**
@ -649,7 +648,6 @@ public interface Spliterator<T> {
* @param action The action
* @throws NullPointerException if the specified action is null
*/
@SuppressWarnings("overloads")
default void forEachRemaining(T_CONS action) {
do { } while (tryAdvance(action));
}

View File

@ -2982,7 +2982,7 @@ public class TreeMap<K,V>
return t.keySpliterator();
}
if (m instanceof DescendingSubMap) {
@SuppressWarnings("unchecked") DescendingSubMap<K,?> dm =
DescendingSubMap<K,?> dm =
(DescendingSubMap<K,?>) m;
TreeMap<K,?> tm = dm.m;
if (dm == tm.descendingMap) {
@ -2991,7 +2991,7 @@ public class TreeMap<K,V>
return t.descendingKeySpliterator();
}
}
@SuppressWarnings("unchecked") NavigableSubMap<K,?> sm =
NavigableSubMap<K,?> sm =
(NavigableSubMap<K,?>) m;
return sm.keySpliterator();
}

View File

@ -744,7 +744,7 @@ public class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
* Returns k.compareTo(x) if x matches kc (k's screened comparable
* class), else 0.
*/
@SuppressWarnings({"rawtypes","unchecked"}) // for cast to Comparable
@SuppressWarnings("unchecked") // for cast to Comparable
static int compareComparables(Class<?> kc, Object k, Object x) {
return (x == null || x.getClass() != kc ? 0 :
((Comparable)k).compareTo(x));

View File

@ -1727,7 +1727,6 @@ public class CopyOnWriteArrayList<E>
}
@Override
@SuppressWarnings("unchecked")
public void forEachRemaining(Consumer<? super E> action) {
Objects.requireNonNull(action);
while (hasNext()) {

View File

@ -576,10 +576,8 @@ public final class Executors {
private static final class PrivilegedCallableUsingCurrentClassLoader<T>
implements Callable<T> {
final Callable<T> task;
@SuppressWarnings("removal")
final ClassLoader ccl;
@SuppressWarnings("removal")
PrivilegedCallableUsingCurrentClassLoader(Callable<T> task) {
this.task = task;
this.ccl = Thread.currentThread().getContextClassLoader();
@ -637,7 +635,6 @@ public final class Executors {
* Thread factory capturing the current class loader.
*/
private static class PrivilegedThreadFactory extends DefaultThreadFactory {
@SuppressWarnings("removal")
final ClassLoader ccl;
PrivilegedThreadFactory() {
@ -647,7 +644,6 @@ public final class Executors {
public Thread newThread(final Runnable r) {
return super.newThread(new Runnable() {
@SuppressWarnings("removal")
public void run() {
Thread.currentThread().setContextClassLoader(ccl);
r.run();

View File

@ -787,7 +787,6 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable {
invokeAll(tasks.toArray(new ForkJoinTask<?>[0]));
return tasks;
}
@SuppressWarnings("unchecked")
List<? extends ForkJoinTask<?>> ts =
(List<? extends ForkJoinTask<?>>) tasks;
Throwable ex = null;

View File

@ -910,7 +910,6 @@ public class LinkedBlockingDeque<E>
*
* @return an array containing all of the elements in this deque
*/
@SuppressWarnings("unchecked")
public Object[] toArray() {
final ReentrantLock lock = this.lock;
lock.lock();

View File

@ -1048,7 +1048,6 @@ public class SubmissionPublisher<T> implements Publisher<T>,
* assignment coding style. Also, all methods and fields have
* default visibility to simplify usage by callers.
*/
@SuppressWarnings("serial")
@jdk.internal.vm.annotation.Contended
static final class BufferedSubscription<T>
implements Subscription, ForkJoinPool.ManagedBlocker {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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
@ -3369,7 +3369,6 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
* Parses the second part of inlined match flags and turns off
* flags appropriately.
*/
@SuppressWarnings("fallthrough")
private void subFlag() {
int ch = peek();
for (;;) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -578,7 +578,7 @@ abstract class AbstractPipeline<E_IN, E_OUT, S extends BaseStream<E_OUT, S>>
@Override
@SuppressWarnings("unchecked")
final <P_IN> boolean copyIntoWithCancel(Sink<P_IN> wrappedSink, Spliterator<P_IN> spliterator) {
@SuppressWarnings({"rawtypes","unchecked"})
@SuppressWarnings("rawtypes")
AbstractPipeline p = AbstractPipeline.this;
while (p.depth > 0) {
p = p.previousStage;
@ -622,7 +622,6 @@ abstract class AbstractPipeline<E_IN, E_OUT, S extends BaseStream<E_OUT, S>>
}
@Override
@SuppressWarnings("unchecked")
final <P_IN> Node<E_OUT> evaluate(Spliterator<P_IN> spliterator,
boolean flatten,
IntFunction<E_OUT[]> generator) {
@ -790,7 +789,6 @@ abstract class AbstractPipeline<E_IN, E_OUT, S extends BaseStream<E_OUT, S>>
* @param spliterator the source {@code Spliterator}
* @return a {@code Spliterator} describing the result of the evaluation
*/
@SuppressWarnings("unchecked")
<P_IN> Spliterator<E_OUT> opEvaluateParallelLazy(PipelineHelper<E_OUT> helper,
Spliterator<P_IN> spliterator) {
return opEvaluateParallel(helper, spliterator, Nodes.castingArray()).spliterator();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2025, 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
@ -324,7 +324,6 @@ abstract class DoublePipeline<E_IN>
}
@Override
@SuppressWarnings("unchecked")
public void accept(double t) {
mapper.accept(t, (DoubleConsumer) downstream);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -356,7 +356,6 @@ abstract class IntPipeline<E_IN>
}
@Override
@SuppressWarnings("unchecked")
public void accept(int t) {
mapper.accept(t, (IntConsumer) downstream);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2025, 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
@ -339,7 +339,6 @@ abstract class LongPipeline<E_IN>
}
@Override
@SuppressWarnings("unchecked")
public void accept(long t) {
mapper.accept(t, (LongConsumer) downstream);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -245,7 +245,6 @@ interface Node<T> {
* @param action a consumer that is to be invoked with each
* element in this {@code Node.OfPrimitive}
*/
@SuppressWarnings("overloads")
void forEach(T_CONS action);
@Override

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -643,7 +643,6 @@ final class Nodes {
final T[] array;
int curSize;
@SuppressWarnings("unchecked")
ArrayNode(long size, IntFunction<T[]> generator) {
if (size >= MAX_ARRAY_SIZE)
throw new IllegalArgumentException(BAD_SIZE);
@ -720,7 +719,6 @@ final class Nodes {
}
@Override
@SuppressWarnings("unchecked")
public T[] asArray(IntFunction<T[]> generator) {
return c.toArray(generator.apply(c.size()));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -202,7 +202,6 @@ abstract class ReferencePipeline<P_IN, P_OUT>
}
@Override
@SuppressWarnings("unchecked")
public final <R> Stream<R> map(Function<? super P_OUT, ? extends R> mapper) {
Objects.requireNonNull(mapper);
return new StatelessOp<>(this, StreamShape.REFERENCE,
@ -509,7 +508,6 @@ abstract class ReferencePipeline<P_IN, P_OUT>
}
@Override
@SuppressWarnings("unchecked")
public void accept(P_OUT u) {
mapper.accept(u, (IntConsumer)downstream);
}
@ -533,7 +531,6 @@ abstract class ReferencePipeline<P_IN, P_OUT>
}
@Override
@SuppressWarnings("unchecked")
public void accept(P_OUT u) {
mapper.accept(u, (LongConsumer) downstream);
}
@ -558,7 +555,6 @@ abstract class ReferencePipeline<P_IN, P_OUT>
}
@Override
@SuppressWarnings("unchecked")
public void accept(P_OUT u) {
mapper.accept(u, (DoubleConsumer) downstream);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -583,7 +583,6 @@ class SpinedBuffer<E>
spineIndex = 0;
}
@SuppressWarnings("overloads")
public void forEach(T_CONS consumer) {
// completed chunks, if any
for (int j = 0; j < spineIndex; j++)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2025, 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
@ -90,7 +90,6 @@ public final class ClassFileImpl implements ClassFile {
null // _ -> null
);
@SuppressWarnings("unchecked")
@Override
public ClassFileImpl withOptions(Option... options) {
var smo = stackMapsOption;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2025, 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
@ -272,7 +272,6 @@ public final class CodeImpl
}
return;
}
@SuppressWarnings("unchecked")
int stackMapPos = ((BoundAttribute<StackMapTableAttribute>) a.get()).payloadStart;
int bci = -1; //compensate for offsetDelta + 1

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2025, 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
@ -49,7 +49,7 @@ import jdk.internal.jimage.decompressor.Decompressor;
* to the jimage file provided by the shipped JDK by tools running on JDK 8.
*/
public class BasicImageReader implements AutoCloseable {
@SuppressWarnings("removal")
@SuppressWarnings({ "removal", "suppression" })
private static boolean isSystemProperty(String key, String value, String def) {
// No lambdas during bootstrap
return AccessController.doPrivileged(
@ -82,7 +82,7 @@ public class BasicImageReader implements AutoCloseable {
private final ImageStringsReader stringsReader;
private final Decompressor decompressor;
@SuppressWarnings({ "removal", "this-escape" })
@SuppressWarnings({ "removal", "this-escape", "suppression" })
protected BasicImageReader(Path path, ByteOrder byteOrder)
throws IOException {
this.imagePath = Objects.requireNonNull(path);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2025, 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
@ -33,7 +33,7 @@ import java.nio.ByteBuffer;
* but also compiled and delivered as part of the jrtfs.jar to support access
* to the jimage file provided by the shipped JDK by tools running on JDK 8.
*/
@SuppressWarnings("removal")
@SuppressWarnings({ "removal", "suppression"} )
class NativeImageBuffer {
static {
java.security.AccessController.doPrivileged(

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2025, 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
@ -70,7 +70,6 @@ final class JrtFileStore extends FileStore {
}
@Override
@SuppressWarnings("unchecked")
public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type) {
Objects.requireNonNull(type, "type");
return (V) null;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2025, 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
@ -68,7 +68,7 @@ public final class JrtFileSystemProvider extends FileSystemProvider {
* Need RuntimePermission "accessSystemModules" to create or get jrt:/
*/
private void checkPermission() {
@SuppressWarnings("removal")
@SuppressWarnings({ "removal", "suppression" })
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
RuntimePermission perm = new RuntimePermission("accessSystemModules");
@ -123,7 +123,7 @@ public final class JrtFileSystemProvider extends FileSystemProvider {
ClassLoader cl = newJrtFsLoader(jrtfs);
try {
Class<?> c = Class.forName(JrtFileSystemProvider.class.getName(), false, cl);
@SuppressWarnings("deprecation")
@SuppressWarnings({ "deprecation", "suppression" })
Object tmp = c.newInstance();
return ((FileSystemProvider)tmp).newFileSystem(uri, newEnv);
} catch (ClassNotFoundException |
@ -156,7 +156,7 @@ public final class JrtFileSystemProvider extends FileSystemProvider {
}
}
@SuppressWarnings("removal")
@SuppressWarnings({ "removal", "suppression" })
private static URLClassLoader newJrtFsLoader(Path jrtfs) {
final URL url;
try {
@ -261,7 +261,6 @@ public final class JrtFileSystemProvider extends FileSystemProvider {
}
@Override
@SuppressWarnings("unchecked")
public <V extends FileAttributeView> V
getFileAttributeView(Path path, Class<V> type, LinkOption... options) {
return JrtFileAttributeView.get(toJrtPath(path), type, options);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2025, 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,7 +47,7 @@ import jdk.internal.jimage.ImageReader.Node;
* but also compiled and delivered as part of the jrtfs.jar to support access
* to the jimage file provided by the shipped JDK by tools running on JDK 8.
*/
@SuppressWarnings("removal")
@SuppressWarnings({ "removal", "suppression"} )
abstract class SystemImage {
abstract Node findNode(String path) throws IOException;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, 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
@ -263,7 +263,6 @@ public final class BootstrapLogger implements Logger, PlatformLogger.Bridge,
// The next event in the queue
LogEvent next;
@SuppressWarnings("removal")
private LogEvent(BootstrapLogger bootstrap, Level level,
ResourceBundle bundle, String msg,
Throwable thrown, Object[] params) {
@ -281,7 +280,6 @@ public final class BootstrapLogger implements Logger, PlatformLogger.Bridge,
this.bootstrap = bootstrap;
}
@SuppressWarnings("removal")
private LogEvent(BootstrapLogger bootstrap, Level level,
Supplier<String> msgSupplier,
Throwable thrown, Object[] params) {
@ -299,7 +297,6 @@ public final class BootstrapLogger implements Logger, PlatformLogger.Bridge,
this.bootstrap = bootstrap;
}
@SuppressWarnings("removal")
private LogEvent(BootstrapLogger bootstrap,
PlatformLogger.Level platformLevel,
String sourceClass, String sourceMethod,
@ -319,7 +316,6 @@ public final class BootstrapLogger implements Logger, PlatformLogger.Bridge,
this.bootstrap = bootstrap;
}
@SuppressWarnings("removal")
private LogEvent(BootstrapLogger bootstrap,
PlatformLogger.Level platformLevel,
String sourceClass, String sourceMethod,
@ -860,7 +856,6 @@ public final class BootstrapLogger implements Logger, PlatformLogger.Bridge,
// The purpose of this class is to delay the initialization of
// the detectedBackend field until it is actually read.
// We do not want this field to get initialized if VM.isBooted() is false.
@SuppressWarnings("removal")
private static final class DetectBackend {
static final LoggingBackend detectedBackend = detectBackend();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, 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
@ -2086,7 +2086,6 @@ public abstract class Parser {
* @exception Exception is parser specific exception form panic method.
* @exception IOException
*/
@SuppressWarnings("fallthrough")
private void pent(char flag) throws Exception {
char ch;
int idx = mBuffIdx + 1;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2025, 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
@ -459,7 +459,7 @@ public class VMSupport {
* @param <X> type of the object representing a decoded error
* @return an immutable list of {@code A} objects
*/
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings("unchecked")
public static <T, A, E, X> List<A> decodeAnnotations(byte[] encoded, AnnotationDecoder<T, A, E, X> decoder) {
try {
ByteArrayInputStream bais = new ByteArrayInputStream(encoded);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2025, 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
@ -156,7 +156,6 @@ public final class LauncherHelper {
* this code determine this value, using a suitable method or omit the
* line entirely.
*/
@SuppressWarnings("fallthrough")
static void showSettings(boolean printToStderr, String optionFlag,
long initialHeapSize, long maxHeapSize, long stackSize) {
@ -733,7 +732,6 @@ public final class LauncherHelper {
*
* @return the application's main class
*/
@SuppressWarnings("fallthrough")
public static Class<?> checkAndLoadMain(boolean printToStderr,
int mode,
String what) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2025, 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
@ -2069,7 +2069,6 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
* Gets the authentication for an HTTP proxy, and applies it to
* the connection.
*/
@SuppressWarnings("fallthrough")
private AuthenticationInfo getHttpProxyAuthentication(AuthenticationHeader authhdr)
throws IOException {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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
@ -338,7 +338,6 @@ public class DictionaryBasedBreakIterator extends RuleBasedBreakIterator {
* cachedBreakPositions so that we only have to do this work once
* for each time we enter the range.
*/
@SuppressWarnings("unchecked")
private void divideUpDictionaryRange(int startPos, int endPos) {
CharacterIterator text = getText();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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
@ -1227,7 +1227,6 @@ public final class LdapCtx extends ComponentDirContext
// process the referrals sequentially
while (true) {
@SuppressWarnings("unchecked")
LdapReferralContext refCtx =
(LdapReferralContext)e.getReferralContext(envprops, bindCtls);
@ -1886,7 +1885,6 @@ public final class LdapCtx extends ComponentDirContext
// process the referrals sequentially
while (true) {
@SuppressWarnings("unchecked")
LdapReferralContext refCtx = (LdapReferralContext)
e.getReferralContext(envprops, bindCtls);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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
@ -96,7 +96,6 @@ public class Continuation extends ResolveResult {
* @param environment The environment used by the caller. It is used
* when setting the "environment" of a CannotProceedException.
*/
@SuppressWarnings("unchecked") // For Hashtable clone: environment.clone()
public Continuation(Name top, Hashtable<?,?> environment) {
super();
starter = top;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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
@ -68,7 +68,6 @@ public interface Name
* ineffectual. Do not use; no replacement.
*/
@Deprecated
@SuppressWarnings("serial")
static final long serialVersionUID = -3617482732056931635L;
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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
@ -340,6 +340,5 @@ public interface Attribute extends Cloneable, java.io.Serializable {
* ineffectual. Do not use; no replacement.
*/
@Deprecated
@SuppressWarnings("serial")
static final long serialVersionUID = 8707690322213556804L;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, 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
@ -58,7 +58,6 @@ class FileSystemPreferences extends AbstractPreferences {
/**
* Sync interval in seconds.
*/
@SuppressWarnings("removal")
private static final int SYNC_INTERVAL = Math.max(1,
Integer.getInteger("java.util.prefs.syncInterval", 30));

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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
@ -44,7 +44,6 @@ public interface RemoteRef extends java.io.Externalizable {
* ineffectual. Do not use; no replacement.
*/
@Deprecated
@SuppressWarnings("serial")
static final long serialVersionUID = 3632638527362204081L;
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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
@ -44,7 +44,6 @@ public interface ServerRef extends RemoteRef {
* ineffectual. Do not use; no replacement.
*/
@Deprecated
@SuppressWarnings("serial")
static final long serialVersionUID = -4557750989390278438L;
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2025, 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
@ -36,7 +36,7 @@ import sun.rmi.transport.StreamRemoteCall;
* Skeleton to dispatch RegistryImpl methods.
* Originally generated by RMIC but frozen to match the stubs.
*/
@SuppressWarnings({"deprecation", "serial"})
@SuppressWarnings("deprecation")
public final class RegistryImpl_Skel
implements java.rmi.server.Skeleton {
private static final java.rmi.server.Operation[] operations = {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2025, 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
@ -31,7 +31,7 @@ import java.io.IOException;
* Skeleton to dispatch DGC methods.
* Originally generated by RMIC but frozen to match the stubs.
*/
@SuppressWarnings({"deprecation", "serial"})
@SuppressWarnings("deprecation")
public final class DGCImpl_Skel
implements java.rmi.server.Skeleton {
private static final java.rmi.server.Operation[] operations = {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -318,7 +318,6 @@ public class SyncFactory {
private static String colon = ":";
private static String strFileSep = "/";
@SuppressWarnings("removal")
private static synchronized void initMapIfNecessary() throws SyncFactoryException {
// Local implementation class names and keys from Properties

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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
@ -286,7 +286,6 @@ public class Date extends java.util.Date {
* @throws NullPointerException if {@code date} is null
* @since 1.8
*/
@SuppressWarnings("deprecation")
public static Date valueOf(LocalDate date) {
return new Date(date.getYear() - 1900, date.getMonthValue() -1,
date.getDayOfMonth());

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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
@ -249,7 +249,6 @@ public class Time extends java.util.Date {
* @throws NullPointerException if {@code time} is null
* @since 1.8
*/
@SuppressWarnings("deprecation")
public static Time valueOf(LocalTime time) {
return new Time(time.getHour(), time.getMinute(), time.getSecond());
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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
@ -493,7 +493,6 @@ public class Timestamp extends java.util.Date {
* @throws NullPointerException if {@code dateTime} is null.
* @since 1.8
*/
@SuppressWarnings("deprecation")
public static Timestamp valueOf(LocalDateTime dateTime) {
return new Timestamp(dateTime.getYear() - 1900,
dateTime.getMonthValue() - 1,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -30,7 +30,7 @@ import java.util.Locale;
/**
* Base class for sort records containing application specific sort keys
*
* @LastModified: May 2019
* @LastModified: Jan 2025
*/
public abstract class NodeSortRecord {
public static final int COMPARE_STRING = 0;
@ -127,7 +127,7 @@ public abstract class NodeSortRecord {
* element. The value is extracted from the DOM if it is not already in
* our sort key vector.
*/
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings("rawtypes")
private final Comparable stringValue(int level) {
// Get value from our array if possible
if (_scanned <= level) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2025, 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
@ -250,7 +250,7 @@ public class SAX2StAXEventWriter extends SAX2StAXBaseWriter {
super.endCDATA();
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings("unchecked")
protected void createStartEvents(Attributes attributes, Collection<Attribute>[] events) {
Map<String, Attribute> nsMap = null;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -65,7 +65,7 @@ import jdk.xml.internal.JdkConstants;
* @author G. Todd Millerj
* @author Jochen Cordes <Jochen.Cordes@t-online.de>
* @author Santiago Pericas-Geertsen
* @LastModified: Nov 2024
* @LastModified: Jan 2025
*/
public final class TemplatesImpl implements Templates, Serializable {
static final long serialVersionUID = 673094361519270707L;
@ -255,7 +255,6 @@ public final class TemplatesImpl implements Templates, Serializable {
* if yes then we need to deserialize the URIResolver
* Fix for bugzilla bug 22438
*/
@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream is)
throws IOException, ClassNotFoundException
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -43,9 +43,8 @@ import org.xml.sax.helpers.XMLFilterImpl;
* @author Santiago Pericas-Geertsen
* @author G. Todd Miller
*
* @LastModified: July 2023
* @LastModified: Jan 2025
*/
@SuppressWarnings("deprecation") //org.xml.sax.helpers.XMLReaderFactory
public class TrAXFilter extends XMLFilterImpl {
private Templates _templates;
private TransformerImpl _transformer;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -100,7 +100,7 @@ import org.xml.sax.ext.LexicalHandler;
* @author Morten Jorgensen
* @author G. Todd Miller
* @author Santiago Pericas-Geertsen
* @LastModified: Dec 2024
* @LastModified: Jan 2025
*/
public final class TransformerImpl extends Transformer
implements DOMCache
@ -1355,7 +1355,6 @@ public final class TransformerImpl extends Transformer
* Performs the access check without any interface changes
* (e.g. Translet and DOMCache).
*/
@SuppressWarnings("unchecked") //AbstractTranslet is the sole impl.
AbstractTranslet t = (AbstractTranslet)translet;
String systemId = SystemIDResolver.getAbsoluteURI(href, baseURI);
String errMsg = null;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -50,9 +50,8 @@ import org.xml.sax.XMLReader;
*
* Added Catalog Support for URI resolution
*
* @LastModified: Nov 2024
* @LastModified: Jan 2025
*/
@SuppressWarnings("deprecation") //org.xml.sax.helpers.XMLReaderFactory
public final class Util {
private static final String property = "org.xml.sax.driver";

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -84,7 +84,7 @@ import org.w3c.dom.traversal.TreeWalker;
* @author Andy Clark, IBM
* @author Ralf Pfeiffer, IBM
* @since PR-DOM-Level-1-19980818.
* @LastModified: Nov 2017
* @LastModified: Jan 2025
*/
public class DocumentImpl
extends CoreDocumentImpl
@ -681,7 +681,7 @@ public class DocumentImpl
* method was invoked by an EventListener; otherwise false.
*/
@Override
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings("unchecked")
protected boolean dispatchEvent(NodeImpl node, Event event) {
if (event == null) return false;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -56,7 +56,7 @@ import org.w3c.dom.Node;
* @xerces.internal
*
* @since PR-DOM-Level-1-19980818.
* @LastModified: June 2022
* @LastModified: Jan 2025
*/
public class NamedNodeMapImpl
implements NamedNodeMap, Serializable {
@ -596,7 +596,6 @@ public class NamedNodeMapImpl
}
}
@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
in.defaultReadObject();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -131,9 +131,8 @@ import org.xml.sax.XMLReader;
* @author Neil Graham, IBM
* @author Pavani Mukthipudi, Sun Microsystems
*
* @LastModified: July 2023
* @LastModified: Jan 2025
*/
@SuppressWarnings("deprecation") //org.xml.sax.helpers.XMLReaderFactory
public class XSDHandler {
/** Feature identifier: validation. */
@ -2768,7 +2767,6 @@ public class XSDHandler {
}
}
@SuppressWarnings("unchecked")
private void addNewImportedGrammars(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
final ArrayList<SchemaGrammar> src = (ArrayList<SchemaGrammar>)srcGrammar.getImportedGrammars();
if (src != null) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -29,7 +29,7 @@ import java.util.Locale;
/**
* International friendly string comparison with case-order
* @author Igor Hersht, igorh@ca.ibm.com
* @LastModified: Oct 2017
* @LastModified: Jan 2025
*/
public class StringComparable implements Comparable<StringComparable> {
@ -52,7 +52,7 @@ public class StringComparable implements Comparable<StringComparable> {
m_mask = getMask(m_collator.getStrength());
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings("rawtypes")
public final static Comparable getComparator( final String text, final Locale locale,
final Collator collator, final String caseOrder){
if((caseOrder == null) ||(caseOrder.length() == 0)){// no case-order specified

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, 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
@ -84,7 +84,6 @@ class CatalogReader extends DefaultHandler implements EntityResolver, URIResolve
*
* @param catalog The Catalog object that represents a catalog
*/
@SuppressWarnings("unchecked")
public CatalogReader(Catalog catalog, SAXParser parser) {
this.catalog = (CatalogImpl) catalog;
this.parser = parser;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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
@ -243,7 +243,6 @@ public class Main {
/**
* Starts main program with the specified arguments.
*/
@SuppressWarnings({"removal"})
public synchronized boolean run(String[] args) {
ok = true;
if (!parseArgs(args)) {
@ -1364,7 +1363,6 @@ public class Main {
});
}
@SuppressWarnings("serial")
Set<ZipEntry> newDirSet() {
return new HashSet<ZipEntry>() {
public boolean add(ZipEntry e) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2025, 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
@ -336,7 +336,6 @@ public class Analyzer {
}
@Override
@SuppressWarnings("unchecked")
public boolean equals(Object o) {
if (o instanceof Dep) {
Dep d = (Dep) o;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2025, 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
@ -56,7 +56,6 @@ public class Dependencies {
/**
* Thrown when a class file cannot be found.
*/
@SuppressWarnings("this-escape")
public static class ClassFileNotFoundException extends Exception {
private static final long serialVersionUID = 3632265927794475048L;
@ -76,7 +75,6 @@ public class Dependencies {
/**
* Thrown when an exception is found processing a class file.
*/
@SuppressWarnings("this-escape")
public static class ClassFileError extends Error {
private static final long serialVersionUID = 4111110813961313203L;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2025, 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
@ -99,7 +99,6 @@ abstract class VersionPropsPlugin extends AbstractPlugin {
private boolean redefined = false;
@SuppressWarnings("deprecation")
private byte[] redefine(String path, byte[] classFile) {
return ClassFile.of().transformClass(newClassReader(path, classFile),
ClassTransform.transformingMethodBodies(

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2025, 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
@ -94,7 +94,6 @@ class BundlerParamInfo<T> {
return stringConverter;
}
@SuppressWarnings("unchecked")
final T fetchFrom(Map<String, ? super Object> params) {
return fetchFrom(params, true);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2025, 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
@ -276,7 +276,6 @@ class StandardBundlerParam<T> extends BundlerParamInfo<T> {
(s, p) -> s
);
@SuppressWarnings("unchecked")
public static final StandardBundlerParam<String> LICENSE_FILE =
new StandardBundlerParam<>(
Arguments.CLIOptions.LICENSE_FILE.getId(),

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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
@ -30,7 +30,7 @@ package com.sun.jndi.rmi.registry;
/**
* ReferenceWrapper_Stub.
*/
@SuppressWarnings({"deprecation", "rawtypes", "unchecked"})
@SuppressWarnings({"deprecation", "rawtypes"})
public final class ReferenceWrapper_Stub
extends java.rmi.server.RemoteStub
implements com.sun.jndi.rmi.registry.RemoteReference, java.rmi.Remote {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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

View File

@ -205,7 +205,6 @@ public class ClassReader {
* @param classFileOffset the offset in byteBuffer of the first byte of the ClassFile to be read.
* @param classFileLength the length in bytes of the ClassFile to be read.
*/
@SuppressWarnings("this-escape")
public ClassReader(
final byte[] classFileBuffer,
final int classFileOffset,

View File

@ -292,7 +292,6 @@ public class ClassWriter extends ClassVisitor {
* do not affect methods that are copied as is in the new class. This means that neither the
* maximum stack size nor the stack frames will be computed for these methods</i>.
*/
@SuppressWarnings("this-escape")
public ClassWriter(final ClassReader classReader, final int flags) {
super(/* latest api = */ Opcodes.ASM9);
this.flags = flags;

View File

@ -275,7 +275,6 @@ public class MethodNode extends MethodVisitor {
}
@Override
@SuppressWarnings("serial")
public AnnotationVisitor visitAnnotationDefault() {
return new AnnotationNode(
new ArrayList<Object>(0) {