Skip to content

8359596: Behavior change when both -Xlint:options and -Xlint:-options flags are given #25840

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

archiecobbs
Copy link
Contributor

@archiecobbs archiecobbs commented Jun 17, 2025

My minor contribution to #24746 (which fixed JDK-8354556) accidentally introduced a change in the compiler's behavior when given conflicting lint flags like -Xlint:options -Xlint:-options. This PR restores the original behavior.

Although this might be considered a weird corner case, many build systems add flags in multiple stages and this can easily result in both flags being added, and so the behavior in this scenario needs to stay consistent.

Basically the code was trying to be too clever; when the original logic is restored, the code gets simpler.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8359844 to be approved

Issues

  • JDK-8359596: Behavior change when both -Xlint:options and -Xlint:-options flags are given (Bug - P2)
  • JDK-8359844: Behavior change when both -Xlint:options and -Xlint:-options flags are given (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25840/head:pull/25840
$ git checkout pull/25840

Update a local copy of the PR:
$ git checkout pull/25840
$ git pull https://git.openjdk.org/jdk.git pull/25840/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25840

View PR using the GUI difftool:
$ git pr show -t 25840

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25840.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 17, 2025

👋 Welcome back acobbs! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 17, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Jun 17, 2025

@archiecobbs The following label will be automatically applied to this pull request:

  • compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@archiecobbs archiecobbs marked this pull request as ready for review June 17, 2025 14:00
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 17, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 17, 2025

Webrevs

@jddarcy
Copy link
Member

jddarcy commented Jun 17, 2025

/csr needed

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jun 17, 2025
@openjdk
Copy link

openjdk bot commented Jun 17, 2025

@jddarcy has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@archiecobbs please create a CSR request for issue JDK-8359596 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

The extra checks for "-Xlint:none" are needed now because of JDK-8352612,
which changed the behavior of "-Xlint:none" to no longer imply "-nowarn",
which allowed the affected warnings to get away with skipping that check.
@uschindler
Copy link
Member

Adding isDisabled() looks fine to me.

Possibly at a later stage we should centralize all the handling using an EnumSet which is populated only once before the compiler is invoked.

The behaviour should be documented in the javac documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler [email protected] csr Pull request needs approved CSR before integration rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants