-
Notifications
You must be signed in to change notification settings - Fork 787
Improved suggestions when unnamed variables are used #5553
Copy link
Copy link
Open
Description
In Java, the _ is not an implicit variable, unlike it in groovy/kotlin, so the substitution does not work. The recommendation is otherwise excellent.
warning: [UnnecessaryOptionalGet] This code can be simplified by directly using the lambda parameters instead of calling get..() on optional.
return firmId.map(_ -> ShareIdentity.builder()
^
(see https://errorprone.info/bugpattern/UnnecessaryOptionalGet)
Did you mean '.sharedToFirmId(_)'? return firmId.map(_ -> ShareIdentity.builder()
.sharedToUserId(edgeId(sharedTo.getUser()))
- .sharedToFirmId(firmId.get())
+ .sharedToFirmId(_)
.identityType(PHONE_NUMBER)
.identity(phoneNumber)
.build());Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels