Fixes #5553 : Skip UnnecessaryOptionalGet when lambda parameter is unnamed by mirkoalicastro · Pull Request #5649 · google/error-prone (original) (raw)
copybara-service Bot pushed a commit that referenced this pull request
…named
UnnecessaryOptionalGet suggested replacing .get() with the lambda parameter name, but the parameter _ (unnamed variable, Java 22+) produces uncompilable code since _ cannot be referenced.
Changes:
- Added an early return when the lambda parameter source is
_ - Added a test guarded by
assume().that(Runtime.version().feature()).isAtLeast(22)
Fixes #5553
Fixes #5649
FUTURE_COPYBARA_INTEGRATE_REVIEW=#5649 from mirkoalicastro:mirkoalicastro/fix-unnecessary-optional-get-unnamed-variable bdcd042 PiperOrigin-RevId: 897687911
copybara-service Bot pushed a commit that referenced this pull request
…named
UnnecessaryOptionalGet suggested replacing .get() with the lambda parameter name, but the parameter _ (unnamed variable, Java 22+) produces uncompilable code since _ cannot be referenced.
Changes:
- Added an early return when the lambda parameter source is
_ - Added a test guarded by
assume().that(Runtime.version().feature()).isAtLeast(22)
Fixes #5553
Fixes #5649
FUTURE_COPYBARA_INTEGRATE_REVIEW=#5649 from mirkoalicastro:mirkoalicastro/fix-unnecessary-optional-get-unnamed-variable bdcd042 PiperOrigin-RevId: 897687291
copybara-service Bot pushed a commit that referenced this pull request
…named
UnnecessaryOptionalGet suggested replacing .get() with the lambda parameter name, but the parameter _ (unnamed variable, Java 22+) produces uncompilable code since _ cannot be referenced.
Changes:
- Added an early return when the lambda parameter source is
_ - Added a test guarded by
assume().that(Runtime.version().feature()).isAtLeast(22)
Fixes #5553
Fixes #5649
FUTURE_COPYBARA_INTEGRATE_REVIEW=#5649 from mirkoalicastro:mirkoalicastro/fix-unnecessary-optional-get-unnamed-variable bdcd042 PiperOrigin-RevId: 897687911
This file contains hidden or 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
[ Show hidden characters]({{ revealButtonHref }})