Skip to content
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

Ignore disabled checks passed to -XepPatchChecks #62

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

Conversation

oxkitsune
Copy link

@oxkitsune oxkitsune commented Jul 17, 2023

Rather than throwing an NoSuchElementException.

Related issue: google#3908

Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline; we can probably add a test in the ScannerSupplierTest.java which makes it a lot easier to see what we are fixing. Additionally, it's nice to have a reproduction case in the code to quickly iterate.

Added a commit 😄.

@oxkitsune oxkitsune force-pushed the gdejong/remove-disabled-checks branch from 163e405 to 9af0e66 Compare July 24, 2023 13:08
@oxkitsune oxkitsune marked this pull request as draft July 26, 2023 07:56
@oxkitsune oxkitsune requested a review from rickie July 26, 2023 08:59
@oxkitsune oxkitsune marked this pull request as ready for review July 26, 2023 08:59
Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a small commit. Really nice fix @oxkitsune 🚀 !

Suggested commit message:

Don't consider disabled checks passed to `-XepPatchChecks`

Fixes #3908.

Alternative suggested commit message:

Have `ScannerSupplier#applyOverrides` only consider enabled checks

Fixes #3908.

Consider could also be a different word like "modify" or "update".

Not too happy with the suggestions, ideas welcome.

@@ -39,6 +39,23 @@ public class ScannerTest {
private final CompilationTestHelper compilationHelper =
CompilationTestHelper.newInstance(ShouldNotUseFoo.class, getClass());

@Test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can move this to the bottom of the class as we are adding it only now. Not a really good reason but it feels like the right thing to do?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't exactly sure if this is the right file for the test, but I agree!

@rickie rickie requested a review from Stephan202 July 27, 2023 15:05
@Stephan202 Stephan202 force-pushed the gdejong/remove-disabled-checks branch from 2dc88b7 to 61cc147 Compare July 30, 2023 10:00
Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased and added a commit. Tweaked suggested commit message:

Ignore disabled checks passed to `-XepPatchChecks`

Rather than throwing an `NoSuchElementException`.

Fixes #3908.

@oxkitsune oxkitsune force-pushed the gdejong/remove-disabled-checks branch from 61cc147 to 4d502e0 Compare July 31, 2023 10:47
@oxkitsune
Copy link
Author

Upstream PR: google#4028

@oxkitsune oxkitsune changed the title Prevent Exception from being thrown when a disabled check is passed to -XepPatchChecks Ignore disabled checks passed to -XepPatchChecks Aug 1, 2023
Rather than throwing an `NoSuchElementException`.

Fixes google#3908.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants