Fix ErrorProne 2.38.0 build failures by updating checker configuration#4257
Fix ErrorProne 2.38.0 build failures by updating checker configuration#4257
Conversation
|
instead of disabling IntLiteralCast, fix the issues |
Fixed the IntLiteralCast violations instead of disabling the check. Replaced 8 instances of Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Fix the other checks as well instead of disabling them Fix each check in its own commit so that I can decide later if I want to keep the fix or disable the check |
Fixed all the ErrorProne checks as requested, with separate commits for each: TimeInStaticInitializer fix (ebfcbc7): Moved time-dependent code out of static initializer in EnumOrdinal fix (7dbf8c2): Replaced AddNullMarkedToPackageInfo: Kept disabled due to Java 8 compatibility - JSpecify 1.0.0 uses Java 9+ features that cause compilation errors with the project's All ErrorProne checks now pass and builds are successful. |
|
@copilot rebase |
|
Use |
Used @SuppressWarnings annotations instead of code fixes as requested. TimeInStaticInitializer suppressed at class level for MockedProfilerSettingsServlet, and EnumOrdinal suppressed at method level for TraceTelemetry and ExceptionTelemetry. All builds pass with ErrorProne 2.38.0. (260ca3a) |
Co-authored-by: trask <218610+trask@users.noreply.github.com>
…d checks Co-authored-by: trask <218610+trask@users.noreply.github.com>
…ead of casting Co-authored-by: trask <218610+trask@users.noreply.github.com>
…ndent code out of static initializer Co-authored-by: trask <218610+trask@users.noreply.github.com>
…instead of ordinal-based array access Co-authored-by: trask <218610+trask@users.noreply.github.com>
…numOrdinal violations Co-authored-by: trask <218610+trask@users.noreply.github.com>
…lizer and EnumOrdinal Co-authored-by: trask <218610+trask@users.noreply.github.com>
…meInStaticInitializer check Co-authored-by: trask <218610+trask@users.noreply.github.com>
…ne 2.38.0 Co-authored-by: trask <218610+trask@users.noreply.github.com>
Co-authored-by: trask <218610+trask@users.noreply.github.com>
This PR fixes build failures that occur when updating ErrorProne from version 2.36.0 to 2.38.0, as attempted in PR #4188.
Problem
The ErrorProne 2.38.0 update introduced several breaking changes:
Java7ApiCheckeris no longer recognized, causing compilation failures-WerrorSolution
Updated the ErrorProne configuration in
buildSrc/src/main/kotlin/ai.errorprone-conventions.gradle.ktsto:disable("Java7ApiChecker")as this check no longer existsdisable("TimeInStaticInitializer")disable("AddNullMarkedToPackageInfo")anddisable("IntLiteralCast")disable("EnumOrdinal")Changes Made
dependencyManagement/build.gradle.ktsto use ErrorProne 2.38.0Testing
This enables the ErrorProne dependency update while maintaining build stability and code quality standards.
Fixes #4256.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.