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.
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
Implement VersionCollection in Java #34050
Implement VersionCollection in Java #34050
Changes from 17 commits
0e475b0
17b9734
8ab7df8
b08b3b6
bd03af5
f0ce80f
4f5ef6d
ca79ab9
fbf8f3e
c72cc95
ff69345
4d54ac8
d01c914
6962565
555ef78
a27505f
c2041d2
5d11cd4
dc328a7
179e54c
7d4a144
7252607
8032307
c576684
47a7b79
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check is moved into version collections.
I tried to move checks and decisions there for better visibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a foreach closure? I'm fine with the name change to "unreleased" instead of "snapshot", but can't we just have bwcVersions.unreleased as a collection that we can iterate here as before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to avoid creating a collection and returning it when the calling code is really interested in iteration. It could have to be a collection of
UnreleasedVersionDescription
built each time, or build once cached. I taught this is simpler and easier to read and fits well with Gradle DSL.We could simply call it
unreleased
if you think the extra detail in the name makes it actually more confusing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the collection should be created once in the constructor, so there shouldn't be any concern about returning it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that having the collections as different views of the same data makes the class harder to understand and in this particular case, it won't make a difference in performance large enough to be worthwhile. Do you see other advantages in doing so besides not having to compute it multiple times ?