JDK-8352731 : Compiler workaround to forcibly set "-Xlint:-options" can be removed
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 25
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2025-03-24
  • Updated: 2025-04-24
  • Resolved: 2025-04-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 b19Fixed
Related Reports
Causes :  
Duplicate :  
Description
This is a "cleanup" issue.

Back in 2011, in order to prevent repeated warnings about bootclasspath not being set (JDK-7022337), this code was added to forcibly set the -Xlint:-options flag after compiler startup:
 
        // forcibly set the equivalent of -Xlint:-options, so that no further
        // warnings about command line options are generated from this point on
        options.put(XLINT_CUSTOM.primaryName + "-" + LintCategory.OPTIONS.option, "true");
        options.remove(XLINT_CUSTOM.primaryName + LintCategory.OPTIONS.option);

This hacky workaround creates a black hole for future warnings that might be added in the `"options"` category and, due to improvements to the compiler design since then, it's also no longer needed to actually fix the problem. So it can be removed.

 As a separate cleanup, the field "optionsCheckingInitiallyDisabled" in JavaCompiler.java is no longer used and so it can also be removed. 
Comments
Changeset: e604bb9e Branch: master Author: Archie Cobbs <acobbs@openjdk.org> Date: 2025-04-11 13:29:32 +0000 URL: https://git.openjdk.org/jdk/commit/e604bb9e9412310d6d63da0b0f475f9da54ff244
11-04-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/24309 Date: 2025-03-29 04:18:36 +0000
29-03-2025