diff -r 14e098407bb0 -r ad69fd32778e src/jdk.compiler/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java Mon Oct 21 15:11:44 2019 +0200 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java Mon Oct 21 15:38:26 2019 +0200 @@ -186,18 +186,18 @@ /** * The log to which to report warnings. */ - private Log log; + private final Log log; /** * Whether or not to report individual warnings, or simply to report a * single aggregate warning at the end of the compilation. */ - private boolean verbose; + private final boolean verbose; /** * The common prefix for all I18N message keys generated by this handler. */ - private String prefix; + private final String prefix; /** * A set containing the names of the source files for which specific @@ -262,4 +262,11 @@ else log.note(file, new Note("compiler", msg, args)); } + + public void clear() { + sourcesWithReportedWarnings = null; + deferredDiagnosticKind = null; + deferredDiagnosticSource = null; + deferredDiagnosticArg = null; + } }