Skip to content

8344159: Add lint warnings for unnecessary warning suppression #24882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 70 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
4fcc612
Track source end positions of declarations that support @SuppressWarn…
archiecobbs Feb 18, 2025
e235228
Add end position for variables coming from variableDeclaratorId().
archiecobbs Feb 18, 2025
daacc44
Fix bug where some warnings didn't have a source file position.
archiecobbs Feb 18, 2025
f5be4ca
Remove no-longer-needed workaround.
archiecobbs Mar 24, 2025
99b3c35
Remove unused code.
archiecobbs Mar 29, 2025
8027224
Merge branch 'JDK-8353221' into JDK-8352731
archiecobbs Mar 29, 2025
0f85a24
Add missing variable decl end position.
archiecobbs Apr 4, 2025
e9931f6
Add new method Log.clear().
archiecobbs Apr 4, 2025
a1108ac
Invoke Log.useSource() before recursing into attribution.
archiecobbs Apr 4, 2025
2344716
Revert accidentally included unrelated changes.
archiecobbs Apr 7, 2025
a9d5845
Reset the DiagnosticHandler stack in clear().
archiecobbs Apr 7, 2025
0127028
Refactoring/cleanup for handling of ending positions.
archiecobbs Apr 8, 2025
f831a10
Add field LintCategory.annotationSuppression.
archiecobbs Apr 8, 2025
0791ff7
Refactor handling of DEPRECATION_ON_IMPORT via new flag Check.importS…
archiecobbs Apr 9, 2025
c491643
Bump copyright.
archiecobbs Apr 9, 2025
5bb0b11
Add "not yet" comment to TEXT_BLOCKS.
archiecobbs Apr 9, 2025
2e68d7a
Small cleanups relating to Log.DiagnosticHandler.
archiecobbs Apr 9, 2025
dc3b98c
Add comment per review suggestion.
archiecobbs Apr 10, 2025
0a9f5e0
Merge branch 'JDK-8354090' into JDK-8348611
archiecobbs Apr 10, 2025
6852ed1
Merge branch 'JDK-8329951' into JDK-8348611
archiecobbs Apr 10, 2025
004cc5f
Merge branch 'JDK-8352731' into JDK-8348611
archiecobbs Apr 10, 2025
20257a5
Merge branch 'JDK-8354071' into JDK-8348611
archiecobbs Apr 10, 2025
0c98da7
Merge branch 'JDK-8350212' into JDK-8348611
archiecobbs Apr 10, 2025
6ff5e73
Merge branch 'JDK-8354216' into JDK-8348611
archiecobbs Apr 10, 2025
de2d3ab
Initial prototype for JDK-8348611.
archiecobbs Apr 10, 2025
7771061
Merge remote-tracking branch 'upstream/master' into JDK-8348611
archiecobbs Apr 11, 2025
e67b47b
Add test for retroactive @SuppressWarnings("dangling-doc-comments") b…
archiecobbs Apr 11, 2025
d0954d4
Remove another unnecessary call to Check.setLint().
archiecobbs Apr 11, 2025
f2bab52
Merge branch 'JDK-8354447' into JDK-8348611
archiecobbs Apr 11, 2025
4d870e0
Revert unintentional change in the behavior of the "dangling-doc-comm…
archiecobbs Apr 11, 2025
fbca756
Update regression test expected output after previous commit.
archiecobbs Apr 11, 2025
d855d51
Remove some obsolete invocations of Check.setLint() and unused imports.
archiecobbs Apr 12, 2025
3f4b5f1
Update ThisEscapeAnalyzer to use LintMapper for Lint calculation.
archiecobbs Apr 12, 2025
f2d2755
Some refactoring & cleanups for ThisEscapeAnalyzer.
archiecobbs Apr 16, 2025
3a6dd76
Some refactoring to make code clearer.
archiecobbs Apr 17, 2025
7c298b4
More cleanups & refactoring.
archiecobbs Apr 22, 2025
d19ad6f
Move LintMapper from "util" to "code" sub-package.
archiecobbs Apr 23, 2025
4523057
Work in progress.
archiecobbs Apr 23, 2025
ffc47b4
Fixes & cleanups.
archiecobbs Apr 23, 2025
26fab07
No need to store context singletons that are only used once.
archiecobbs Apr 23, 2025
5f003d1
Update copyrights.
archiecobbs Apr 23, 2025
67ce889
Merge branch 'JDK-8350212' into JDK-8348611
archiecobbs Apr 23, 2025
992628c
Merge branch 'JDK-8348611' into JDK-8348611+suppression
archiecobbs Apr 23, 2025
7a3ab82
Minor refactoring & cleanup.
archiecobbs Apr 23, 2025
78eef15
Update copyrights.
archiecobbs Apr 23, 2025
9394f7e
Merge branch 'master' into JDK-8348611
archiecobbs Apr 24, 2025
3cd938a
Cleanups.
archiecobbs Apr 24, 2025
b96dcf8
Merge branch 'JDK-8348611' into JDK-8348611+suppression
archiecobbs Apr 25, 2025
8885414
Javadoc++
archiecobbs Apr 25, 2025
c26364a
Reduce the number of diffs vs. branch JDK-8348611.
archiecobbs Apr 25, 2025
5ef9606
Refactor ThisEscapeAnalyzer to correct bug in suppression logic.
archiecobbs Apr 28, 2025
b8c3dcd
Merge branch 'JDK-8355753' into JDK-8348611
archiecobbs Apr 28, 2025
8c0e6b7
Merge branch 'JDK-8348611' into JDK-8348611+suppression
archiecobbs Apr 28, 2025
ddb0d4e
Update copyrights.
archiecobbs Apr 28, 2025
92fc475
Merge branch 'JDK-8348611' into JDK-8348611+suppression
archiecobbs Apr 28, 2025
a356d88
Merge branch 'master' into JDK-8348611 to fix conflict.
archiecobbs May 1, 2025
e63a5a3
Merge branch 'JDK-8348611' into JDK-8348611+suppression
archiecobbs May 1, 2025
81a25ca
Merge branch 'master' into JDK-8348611 to fix conflicts.
archiecobbs May 5, 2025
b297ce7
Merge branch 'JDK-8348611' into JDK-8348611+suppression to fix confli…
archiecobbs May 5, 2025
d481616
Add a new "-Xlint:suppression" flag (required for HelloClasslist.java).
archiecobbs May 5, 2025
102beb5
Merge branch 'master' into JDK-8348611
archiecobbs May 7, 2025
30100f1
Merge branch 'JDK-8348611' into JDK-8348611+suppression
archiecobbs May 7, 2025
7871c04
Document new lint categories in Javadoc and man page.
archiecobbs May 10, 2025
563a143
Merge branch 'master' into JDK-8348611
archiecobbs May 10, 2025
a96802e
Merge branch 'JDK-8348611' into JDK-8348611+suppression
archiecobbs May 10, 2025
338ba2a
Add support for the "suppression" lint category.
archiecobbs May 10, 2025
6081c7e
Merge branch 'JDK-8344159' into JDK-8348611+suppression
archiecobbs May 10, 2025
f2f50d9
Revert accidental disabling of regression tests.
archiecobbs May 10, 2025
cb09746
Update copyright years.
archiecobbs May 10, 2025
fba332e
Merge branch 'JDK-8344159' into JDK-8348611+suppression
archiecobbs May 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions make/CompileToolsJdk.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
build/tools/jigsaw \
build/tools/depend, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
DISABLED_WARNINGS := dangling-doc-comments options, \
DISABLED_WARNINGS := dangling-doc-comments options suppression, \
JAVAC_FLAGS := \
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
--add-exports java.base/sun.text=ALL-UNNAMED \
Expand Down Expand Up @@ -81,7 +81,7 @@ $(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
SRC := $(TOPDIR)/make/jdk/src/classes, \
INCLUDES := build/tools/depend, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/depend, \
DISABLED_WARNINGS := options, \
DISABLED_WARNINGS := options suppression, \
JAVAC_FLAGS := \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
Expand Down
2 changes: 1 addition & 1 deletion make/GenerateLinkOptData.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $(eval $(call SetupJavaCompilation, CLASSLIST_JAR, \
SMALL_JAVA := false, \
SRC := $(TOPDIR)/make/jdk/src/classes, \
INCLUDES := build/tools/classlist, \
DISABLED_WARNINGS := dangling-doc-comments, \
DISABLED_WARNINGS := dangling-doc-comments suppression, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/classlist_classes, \
JAR := $(SUPPORT_OUTPUTDIR)/classlist.jar, \
))
Expand Down
2 changes: 1 addition & 1 deletion make/JrtfsJar.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ JIMAGE_PKGS := \
# ends up in the image, this will ensure reproducible classes
$(eval $(call SetupJavaCompilation, BUILD_JRTFS, \
COMPILER := interim, \
DISABLED_WARNINGS := options, \
DISABLED_WARNINGS := options suppression, \
TARGET_RELEASE := $(TARGET_RELEASE_JDK8), \
SRC := $(TOPDIR)/src/java.base/share/classes, \
EXCLUDE_FILES := module-info.java, \
Expand Down
7 changes: 7 additions & 0 deletions make/common/JavaCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ define SetupJavaCompilationBody
# If unspecified, default to the new jdk we're building
$1_TARGET_RELEASE := $$(TARGET_RELEASE_NEWJDK)
endif

# Always disable "suppression-option" because, thanks to the Depend plugin, we will
# only compile the source files that need to be recompiled, so the "suppression-option"
# lint warning can generate a false positive if some source file that would otherwise
# generate a suppressed lint warning is not included in the compilation. With a fresh
# build, it would be safe to enable "suppression-option" (TODO: automate doing that).
$1_FLAGS += -Xlint:-suppression-option
else
$$(error Invalid value for COMPILER in SetupJavaCompilation for $1: '$$($1_COMPILER)')
endif
Expand Down
4 changes: 2 additions & 2 deletions make/modules/java.base/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
# The base module should be built with all warnings enabled. When a
# new warning is added to javac, it can be temporarily added to the
# disabled warnings list.
#
# DISABLED_WARNINGS_java +=

DISABLED_WARNINGS_java += suppression

DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*'
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.desktop/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += dangling-doc-comments lossy-conversions this-escape
DISABLED_WARNINGS_java += dangling-doc-comments lossy-conversions this-escape suppression
DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*'
COPY += .gif .png .wav .txt .xml .css .pf
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.management/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += dangling-doc-comments this-escape
DISABLED_WARNINGS_java += dangling-doc-comments this-escape suppression

DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*'
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.naming/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += dangling-doc-comments this-escape
DISABLED_WARNINGS_java += dangling-doc-comments this-escape suppression

DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*'
Expand Down
2 changes: 2 additions & 0 deletions make/modules/java.prefs/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

################################################################################

DISABLED_WARNINGS_java += suppression

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

Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.rmi/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += this-escape
DISABLED_WARNINGS_java += this-escape suppression

DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*'
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.sql.rowset/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += dangling-doc-comments
DISABLED_WARNINGS_java += dangling-doc-comments suppression

DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*'
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.sql/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += dangling-doc-comments this-escape
DISABLED_WARNINGS_java += dangling-doc-comments this-escape suppression

DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*'
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.xml.crypto/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += dangling-doc-comments this-escape
DISABLED_WARNINGS_java += dangling-doc-comments this-escape suppression

DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*'
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.xml/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += dangling-doc-comments lossy-conversions this-escape
DISABLED_WARNINGS_java += dangling-doc-comments lossy-conversions this-escape suppression
DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \
javax.xml.transform javax.xml.validation javax.xml.xpath)'
Expand Down
30 changes: 30 additions & 0 deletions make/modules/jdk.attach/Java.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

################################################################################

DISABLED_WARNINGS_java += suppression

################################################################################
2 changes: 2 additions & 0 deletions make/modules/jdk.dynalink/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

################################################################################

DISABLED_WARNINGS_java += suppression

CLEAN += .properties

################################################################################
2 changes: 1 addition & 1 deletion make/modules/jdk.internal.le/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += dangling-doc-comments this-escape
DISABLED_WARNINGS_java += dangling-doc-comments this-escape suppression

COPY += .properties .caps .txt

Expand Down
2 changes: 2 additions & 0 deletions make/modules/jdk.jartool/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

################################################################################

DISABLED_WARNINGS_java += suppression

JAVAC_FLAGS += -XDstringConcat=inline

################################################################################
2 changes: 2 additions & 0 deletions make/modules/jdk.jdeps/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

################################################################################

DISABLED_WARNINGS_java += suppression

COPY += .txt

CLEAN_FILES += $(wildcard \
Expand Down
2 changes: 1 addition & 1 deletion make/modules/jdk.jfr/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += dangling-doc-comments exports
DISABLED_WARNINGS_java += dangling-doc-comments exports suppression
COPY := .xsd .xml .dtd .ini
JAVAC_FLAGS := -XDstringConcat=inline

Expand Down
2 changes: 2 additions & 0 deletions make/modules/jdk.jlink/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
# upgrade_files_<module-name>.conf files
COPY += .conf

DISABLED_WARNINGS_java += suppression

################################################################################
2 changes: 1 addition & 1 deletion make/modules/jdk.jpackage/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

################################################################################

DISABLED_WARNINGS_java += dangling-doc-comments
DISABLED_WARNINGS_java += dangling-doc-comments suppression

COPY += .gif .png .txt .spec .script .prerm .preinst \
.postrm .postinst .list .sh .desktop .copyright .control .plist .template \
Expand Down
2 changes: 2 additions & 0 deletions make/modules/jdk.jshell/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

################################################################################

DISABLED_WARNINGS_java += suppression

COPY += .jsh .properties

################################################################################
30 changes: 30 additions & 0 deletions make/modules/jdk.management.agent/Java.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

################################################################################

DISABLED_WARNINGS_java += suppression

################################################################################
30 changes: 30 additions & 0 deletions make/modules/jdk.management.jfr/Java.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

################################################################################

DISABLED_WARNINGS_java += suppression

################################################################################
2 changes: 1 addition & 1 deletion make/modules/jdk.management/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@

################################################################################

DISABLED_WARNINGS_java += this-escape
DISABLED_WARNINGS_java += this-escape suppression

################################################################################
30 changes: 30 additions & 0 deletions make/modules/jdk.naming.rmi/Java.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

################################################################################

DISABLED_WARNINGS_java += suppression

################################################################################
2 changes: 1 addition & 1 deletion make/test/BuildFailureHandler.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $(eval $(call SetupJavaCompilation, BUILD_FAILURE_HANDLER, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := $(FH_BASEDIR)/src/share/classes $(FH_BASEDIR)/src/share/conf, \
BIN := $(FH_SUPPORT)/classes, \
DISABLED_WARNINGS := options serial try this-escape, \
DISABLED_WARNINGS := options serial try this-escape suppression, \
COPY := .properties, \
CLASSPATH := $(JTREG_JAR) $(TOOLS_JAR), \
JAR := $(FH_JAR), \
Expand Down
2 changes: 1 addition & 1 deletion make/test/BuildMicrobenchmark.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
CLASSPATH := $(JMH_COMPILE_JARS), \
CREATE_API_DIGEST := true, \
DISABLED_WARNINGS := restricted this-escape processing rawtypes removal cast \
serial preview dangling-doc-comments, \
serial preview dangling-doc-comments suppression, \
SRC := $(MICROBENCHMARK_SRC), \
BIN := $(MICROBENCHMARK_CLASSES), \
JAVAC_FLAGS := \
Expand Down
1 change: 1 addition & 0 deletions make/test/BuildTestLib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
BIN := $(TEST_LIB_SUPPORT)/test-lib_classes, \
HEADERS := $(TEST_LIB_SUPPORT)/test-lib_headers, \
JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \
DISABLED_WARNINGS := suppression, \
JAVAC_FLAGS := --add-exports java.base/sun.security.util=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.attribute=ALL-UNNAMED \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2021, 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
Expand Down Expand Up @@ -412,6 +412,7 @@ public void process(Env<AttrContext> env) {
f.run(compiler.todo, classes);
}
} finally {
compiler.log.reportOutstandingWarnings();
compiler.log.flush();
}
return results;
Expand Down Expand Up @@ -483,8 +484,10 @@ public void process(Env<AttrContext> env) {
}
}
finally {
if (compiler != null)
if (compiler != null) {
compiler.log.reportOutstandingWarnings();
compiler.log.flush();
}
}
return results;
}
Expand Down
Loading