Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gavinking
Copy link
Contributor

This is way more friendly to both users and implementors.

Iterable is an absolute PITA to work with, both for users, when a method returns Iterable, and for implementors, when a method accepts it. And there are no interesting types which implement Iterable but not Collection.

Now, I considered making the substitution Iterable -> Collection, but really all that allows is Sets. And here, in lifecycle methods, Set actually has the wrong semantics, because the returned values are correlated with input values by their order.

So List is really the right thing to use here!

Copy link
Contributor

@njr-11 njr-11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List will be much more convenient for users than Iterable for accessing and using the results. In addition to the changes you made, there is also an occurrence of Iterable that needs updating to List in module-info.

 * <li>the class of the entity, or</li>
 * <li>{@code Iterable<E>} or {@code E[]} where {@code E} is the class of the
 *     entities.</li>
 * </ul>

@gavinking
Copy link
Contributor Author

there is also an occurrence of Iterable that needs updating to List in module-info.

Thanks, fixed!

@gavinking
Copy link
Contributor Author

@otaviojava any objections to this?

@otaviojava otaviojava merged commit 584db29 into jakartaee:main Mar 18, 2024
@otaviojava
Copy link
Contributor

@otaviojava any objections to this?

Nope, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants