Skip to content

Commit 661bd5b

Browse files
committed
8343478: Remove unnecessary @SuppressWarnings annotations (core-libs)
Reviewed-by: darcy, asemenyuk, joehw
1 parent 61d9ab9 commit 661bd5b

File tree

93 files changed

+121
-211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+121
-211
lines changed

make/jdk/src/classes/build/tools/cldrconverter/Bundle.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -198,7 +198,6 @@ Map<String, Object> getTargetMap() throws Exception {
198198
String[] cldrBundles = getCLDRPath().split(",");
199199

200200
// myMap contains resources for id.
201-
@SuppressWarnings("unchecked")
202201
Map<String, Object> myMap = new HashMap<>();
203202
int index;
204203
for (index = 0; index < cldrBundles.length; index++) {

make/jdk/src/classes/build/tools/cldrconverter/LDMLParseHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1079,7 +1079,6 @@ private String getTarget(String path, String calType, String context, String wid
10791079
}
10801080

10811081
@Override
1082-
@SuppressWarnings("fallthrough")
10831082
public void endElement(String uri, String localName, String qName) throws SAXException {
10841083
assert qName.equals(currentContainer.getqName()) : "current=" + currentContainer.getqName() + ", param=" + qName;
10851084
switch (qName) {

src/java.base/share/classes/java/io/File.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,6 @@ public URL toURL() throws MalformedURLException {
681681
if (isInvalid()) {
682682
throw new MalformedURLException("Invalid file path");
683683
}
684-
@SuppressWarnings("deprecation")
685684
var result = new URL("file", "", slashify(getAbsolutePath(), isDirectory()));
686685
return result;
687686
}

src/java.base/share/classes/java/io/FileDescriptor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -340,7 +340,6 @@ synchronized void attach(Closeable c) {
340340
*
341341
* The caller closeable gets to call close0().
342342
*/
343-
@SuppressWarnings("try")
344343
synchronized void closeAll(Closeable releaser) throws IOException {
345344
if (!closed) {
346345
closed = true;

src/java.base/share/classes/java/lang/Package.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ public boolean isCompatibleWith(String desired)
353353
*/
354354
@CallerSensitive
355355
@Deprecated(since="9")
356-
@SuppressWarnings("deprecation")
357356
public static Package getPackage(String name) {
358357
ClassLoader l = ClassLoader.getClassLoader(Reflection.getCallerClass());
359358
return l != null ? l.getPackage(name) : BootLoader.getDefinedPackage(name);

src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -142,7 +142,7 @@ public String toString() {
142142
return buf.toString();
143143
}
144144

145-
@SuppressWarnings({"rawtypes", "unchecked"})
145+
@SuppressWarnings("unchecked")
146146
public LambdaForm get() {
147147
if (cache instanceof LambdaForm lf) {
148148
return lf;

src/java.base/share/classes/java/lang/invoke/MemberName.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -711,7 +711,7 @@ public MemberName getDefinition() {
711711
}
712712

713713
@Override
714-
@SuppressWarnings({"deprecation", "removal"})
714+
@SuppressWarnings("removal")
715715
public int hashCode() {
716716
// Avoid autoboxing getReferenceKind(), since this is used early and will force
717717
// early initialization of Byte$ByteCache

src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -110,7 +110,7 @@ public MethodType basicType() {
110110
return basicType;
111111
}
112112

113-
@SuppressWarnings({"rawtypes", "unchecked"})
113+
@SuppressWarnings("unchecked")
114114
public MethodHandle cachedMethodHandle(int which) {
115115
Object entry = methodHandles[which];
116116
if (entry == null) {
@@ -136,7 +136,7 @@ public synchronized MethodHandle setCachedMethodHandle(int which, MethodHandle m
136136
return mh;
137137
}
138138

139-
@SuppressWarnings({"rawtypes", "unchecked"})
139+
@SuppressWarnings("unchecked")
140140
public LambdaForm cachedLambdaForm(int which) {
141141
Object entry = lambdaForms[which];
142142
if (entry == null) {
@@ -167,7 +167,6 @@ public synchronized LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
167167
* This MTF will stand for that type and all un-erased variations.
168168
* Eagerly compute some basic properties of the type, common to all variations.
169169
*/
170-
@SuppressWarnings({"rawtypes", "unchecked"})
171170
protected MethodTypeForm(MethodType erasedType) {
172171
this.erasedType = erasedType;
173172

src/java.base/share/classes/java/lang/reflect/Constructor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -240,7 +240,7 @@ public int getModifiers() {
240240
* @since 1.5
241241
*/
242242
@Override
243-
@SuppressWarnings({"rawtypes", "unchecked"})
243+
@SuppressWarnings("unchecked")
244244
public TypeVariable<Constructor<T>>[] getTypeParameters() {
245245
if (getSignature() != null) {
246246
return (TypeVariable<Constructor<T>>[])getGenericInfo().getTypeParameters();

src/java.base/share/classes/java/lang/reflect/Method.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -231,7 +231,7 @@ public int getModifiers() {
231231
* @jls 8.4.4 Generic Methods
232232
*/
233233
@Override
234-
@SuppressWarnings({"rawtypes", "unchecked"})
234+
@SuppressWarnings("unchecked")
235235
public TypeVariable<Method>[] getTypeParameters() {
236236
if (getGenericSignature() != null)
237237
return (TypeVariable<Method>[])getGenericInfo().getTypeParameters();

0 commit comments

Comments
 (0)