-
Notifications
You must be signed in to change notification settings - Fork 744
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
Lazily load plugin checks when running auto-patching #4467
Closed
msridhar
wants to merge
1
commit into
google:master
from
msridhar:lazy-load-plugin-checks-when-autopatching
Closed
Lazily load plugin checks when running auto-patching #4467
msridhar
wants to merge
1
commit into
google:master
from
msridhar:lazy-load-plugin-checks-when-autopatching
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cushon
approved these changes
Jul 15, 2024
copybara-service bot
pushed a commit
that referenced
this pull request
Jul 15, 2024
When running in normal checking mode, Error Prone loads plugin checks lazily to delay the loading until after the javac file manager is initialized; see [here](https://github.com/google/error-prone/blob/8f9e7da16b81b9fd65cca5fef9a79a4e6019eabd/check_api/src/main/java/com/google/errorprone/ErrorProneAnalyzer.java#L145-L159). This change introduces the same lazy loading when running Error Prone in auto-patching mode. In most scenarios I've seen, applying suggested fixes from plugin checks works fine, but when trying to generate patches on Bazel (see bazelbuild/bazel#21640), things do not work without this change. The previous code was "forcing" a `Supplier` and then re-wrapping the result in a `Supplier` again; this change mostly just gets rid of that. Fixes #4467 FUTURE_COPYBARA_INTEGRATE_REVIEW=#4467 from msridhar:lazy-load-plugin-checks-when-autopatching 728e3f9 PiperOrigin-RevId: 652625022
copybara-service bot
pushed a commit
that referenced
this pull request
Jul 15, 2024
When running in normal checking mode, Error Prone loads plugin checks lazily to delay the loading until after the javac file manager is initialized; see [here](https://github.com/google/error-prone/blob/8f9e7da16b81b9fd65cca5fef9a79a4e6019eabd/check_api/src/main/java/com/google/errorprone/ErrorProneAnalyzer.java#L145-L159). This change introduces the same lazy loading when running Error Prone in auto-patching mode. In most scenarios I've seen, applying suggested fixes from plugin checks works fine, but when trying to generate patches on Bazel (see bazelbuild/bazel#21640), things do not work without this change. The previous code was "forcing" a `Supplier` and then re-wrapping the result in a `Supplier` again; this change mostly just gets rid of that. Fixes #4467 FUTURE_COPYBARA_INTEGRATE_REVIEW=#4467 from msridhar:lazy-load-plugin-checks-when-autopatching 728e3f9 PiperOrigin-RevId: 652625022
benkard
pushed a commit
to benkard/jgvariant
that referenced
this pull request
Jul 19, 2024
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [com.google.errorprone:error_prone_core](https://errorprone.info) ([source](https://github.com/google/error-prone)) | | minor | `2.28.0` -> `2.29.2` | | [com.google.errorprone:error_prone_annotations](https://errorprone.info) ([source](https://github.com/google/error-prone)) | compile | minor | `2.28.0` -> `2.29.2` | --- ### Release Notes <details> <summary>google/error-prone</summary> ### [`v2.29.2`](https://github.com/google/error-prone/releases/tag/v2.29.2): Error Prone 2.29.2 [Compare Source](google/error-prone@v2.29.1...v2.29.2) This release contains all of the changes in [2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0) and [2.29.1](https://github.com/google/error-prone/releases/tag/v2.29.1), plus: - a bug fix for a crash in `TraditionalSwitchExpression` (google/error-prone#4479) - restores the `module-info` for the annotations jar, which was accidentally removed (google/error-prone#4480) Full Changelog: google/error-prone@v2.29.1...v2.29.2 ### [`v2.29.1`](https://github.com/google/error-prone/releases/tag/v2.29.1): Error Prone 2.29.1 [Compare Source](google/error-prone@v2.29.0...v2.29.1) This release contains all of the changes in [2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0), plus: - a bug fix to `UnusedVariable` to handle unnamed `_` variables (google/error-prone#4451) - a bug fix for a crash in `SetUnrecognized` (google/error-prone#4475) Full Changelog: google/error-prone@v2.29.0...v2.29.1 ### [`v2.29.0`](https://github.com/google/error-prone/releases/tag/v2.29.0): Error Prone 2.29.0 [Compare Source](google/error-prone@v2.28.0...v2.29.0) New checks: - [`MissingRuntimeRetention`](https://errorprone.info/bugpattern/MissingRuntimeRetention) - [`SetUnrecognized`](https://errorprone.info/bugpattern/SetUnrecognized) - [`StatementSwitchToExpressionSwitch`](https://errorprone.info/bugpattern/StatementSwitchToExpressionSwitch) Closed issues: [#​4318](google/error-prone#4318), [#​4429](google/error-prone#4429), [#​4467](google/error-prone#4467) Full Changelog: google/error-prone@v2.28.0...v2.29.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running in normal checking mode, Error Prone loads plugin checks lazily to delay the loading until after the javac file manager is initialized; see here. This change introduces the same lazy loading when running Error Prone in auto-patching mode. In most scenarios I've seen, applying suggested fixes from plugin checks works fine, but when trying to generate patches on Bazel (see bazelbuild/bazel#21640), things do not work without this change. The previous code was "forcing" a
Supplier
and then re-wrapping the result in aSupplier
again; this change mostly just gets rid of that.