Skip to content

Commit c799cad

Browse files
committedNov 5, 2024
8343486: Remove unnecessary @SuppressWarnings annotations and -Xlint:-foo options
Reviewed-by: ihse
1 parent 0b733e9 commit c799cad

File tree

13 files changed

+8
-119
lines changed

13 files changed

+8
-119
lines changed
 

‎make/modules/java.sql.rowset/Java.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments
2727

2828
DOCLINT += -Xdoclint:all/protected \
2929
'-Xdoclint/package:java.*,javax.*'

‎make/modules/jdk.httpserver/Java.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += missing-explicit-ctor this-escape
26+
DISABLED_WARNINGS_java += this-escape
2727

2828
COPY += .ico

‎make/modules/jdk.jartool/Java.gmk

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, 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
@@ -23,5 +23,4 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += missing-explicit-ctor
2726
JAVAC_FLAGS += -XDstringConcat=inline

‎make/modules/jdk.jdi/Java.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments
2727

2828
EXCLUDES += \
2929
com/sun/tools/example/debug/bdi \

‎make/modules/jdk.jlink/Java.gmk

-26
This file was deleted.

‎make/modules/jdk.jstatd/Java.gmk

-26
This file was deleted.

‎make/modules/jdk.unsupported/Java.gmk

-26
This file was deleted.

‎make/modules/jdk.zipfs/Java.gmk

-27
This file was deleted.

‎src/java.base/share/classes/jdk/internal/icu/text/BidiBase.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2009, 2024, 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
@@ -4744,7 +4744,6 @@ private static class TextAttributeConstants {
47444744
static final Boolean RUN_DIRECTION_LTR = (jafa == null) ?
47454745
Boolean.FALSE : (Boolean)jafa.getTextAttributeConstant("RUN_DIRECTION_LTR");
47464746

4747-
@SuppressWarnings("serial")
47484747
private static AttributedCharacterIterator.Attribute
47494748
getTextAttribute(String name)
47504749
{

‎src/jdk.dynalink/share/classes/jdk/dynalink/BiClassValue.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024, 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
@@ -113,7 +113,6 @@ T getReverseValue(final Class<?> c) {
113113
}
114114

115115
private T compute(final VarHandle mapHandle, final Class<?> c, final Function<Class<?>, T> compute) {
116-
@SuppressWarnings("unchecked")
117116
Map<Class<?>, T> map = (Map<Class<?>, T>) mapHandle.getVolatile(this);
118117
T value;
119118
T newValue = null;
@@ -128,7 +127,6 @@ private T compute(final VarHandle mapHandle, final Class<?> c, final Function<Cl
128127
final Map.Entry<Class<?>, T>[] entries = map.entrySet().toArray(new Map.Entry[map.size() + 1]);
129128
entries[map.size()] = Map.entry(c, newValue);
130129
final var newMap = Map.ofEntries(entries);
131-
@SuppressWarnings("unchecked")
132130
final var witness = (Map<Class<?>, T>) mapHandle.compareAndExchange(this, map, newMap);
133131
if (witness == map) {
134132
value = newValue;

‎src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedDynamicMethod.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2024, 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
@@ -151,7 +151,7 @@ MethodHandle getInvocation(final CallSiteDescriptor callSiteDescriptor, final Li
151151
// This is typical for very generic signatures at call sites. Typical example: call site specifies
152152
// (Object, Object), and we have a method whose parameter types are (String, int). None of the JLS applicability
153153
// rules will trigger, but we must consider the method, as it can be the right match for a concrete invocation.
154-
@SuppressWarnings({ "unchecked", "rawtypes" })
154+
@SuppressWarnings("unchecked")
155155
final List<SingleDynamicMethod> invokables = (List)methods.clone();
156156
invokables.removeAll(subtypingApplicables.getMethods());
157157
invokables.removeAll(methodInvocationApplicables.getMethods());

‎src/jdk.jsobject/share/classes/module-info.java

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
* @deprecated The jdk.jsobject module will be delivered with JavaFX.
3232
*/
3333
@Deprecated(since = "24", forRemoval = true)
34-
@SuppressWarnings("removal")
3534
module jdk.jsobject {
3635
exports netscape.javascript;
3736
}

‎src/jdk.jsobject/share/classes/netscape/javascript/JSException.java

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* @deprecated The jdk.jsobject module will be delivered with JavaFX.
3434
*/
3535
@Deprecated(since = "24", forRemoval = true)
36-
@SuppressWarnings("removal")
3736
public class JSException extends RuntimeException {
3837
private static final long serialVersionUID = 2778103758223661489L;
3938

0 commit comments

Comments
 (0)
Please sign in to comment.