Repository navigation
Accept any annotation with the simple name @Generated - #2125
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_352461144
branch
from
January 19, 2021 20:04
59de496 to
4d6a0cc
Compare
Stephan202
reviewed
Jan 19, 2021
Comment on lines
+1376
to
+1378
| .map(e -> MoreAnnotations.asStrings((AnnotationValue) e.getValue())) | ||
| .findAny() | ||
| .orElse(Stream.of(attribute.type.tsym.getQualifiedName().toString())); |
Contributor
There was a problem hiding this comment.
Late to the party, but would suggest:
Suggested change
| .map(e -> MoreAnnotations.asStrings((AnnotationValue) e.getValue())) | |
| .findAny() | |
| .orElse(Stream.of(attribute.type.tsym.getQualifiedName().toString())); | |
| .findFirst() | |
| .map(e -> MoreAnnotations.asStrings((AnnotationValue) e.getValue())) | |
| .orElseGet(() -> Stream.of(attribute.type.tsym.getQualifiedName().toString())); |
.firstFirstjust because that's what happens in practice in this non-parallel stream, and is thus arguably clearer than.findAny..mapafter.findFirstto clarify that only one map operation will be performed..orElseGetrather than.orElsefor efficiency.
copybara-service Bot
pushed a commit
that referenced
this pull request
Jan 19, 2021
PiperOrigin-RevId: 352644905
copybara-service Bot
pushed a commit
that referenced
this pull request
Jan 19, 2021
PiperOrigin-RevId: 352653897
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
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.
Accept any annotation with the simple name
@Generatedto support non-standard annotations.
Fixes #1984, #1863