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
#705 Add interfaces for MultiReader List/Set/Bag #719
Conversation
...ections-api/src/main/java/org/eclipse/collections/api/factory/bag/MultiReaderBagFactory.java
Outdated
Show resolved
Hide resolved
...ections-api/src/main/java/org/eclipse/collections/api/factory/bag/MultiReaderBagFactory.java
Outdated
Show resolved
Hide resolved
eclipse-collections-api/src/main/java/org/eclipse/collections/api/bag/MultiReaderBag.java
Show resolved
Hide resolved
...tions-api/src/main/java/org/eclipse/collections/api/factory/list/MultiReaderListFactory.java
Show resolved
Hide resolved
...tions-api/src/main/java/org/eclipse/collections/api/factory/list/MultiReaderListFactory.java
Outdated
Show resolved
Hide resolved
...tions-api/src/main/java/org/eclipse/collections/api/factory/list/MultiReaderListFactory.java
Outdated
Show resolved
Hide resolved
...ections-api/src/main/java/org/eclipse/collections/api/factory/set/MultiReaderSetFactory.java
Show resolved
Hide resolved
...ections-api/src/main/java/org/eclipse/collections/api/factory/set/MultiReaderSetFactory.java
Outdated
Show resolved
Hide resolved
...ections-api/src/main/java/org/eclipse/collections/api/factory/set/MultiReaderSetFactory.java
Outdated
Show resolved
Hide resolved
eclipse-collections-api/src/main/java/org/eclipse/collections/api/list/MultiReaderList.java
Show resolved
Hide resolved
eclipse-collections-api/src/main/java/org/eclipse/collections/api/set/MultiReaderSet.java
Show resolved
Hide resolved
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.
Thank you for submitting this. This PR looks mostly good. Primarily changes requested on at since tags. A couple of questions on dependency additions in pom.xml as well.
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.
LGTM overall. Would be interesting to get the group's thoughts on the interface hierarchy and bounded wildcards.
* @since 10.0. | ||
*/ | ||
public interface MultiReaderBag<T> | ||
extends MutableBag<T> |
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.
An interesting question is whether these should extend MutableBagIterable vs MutableBag, MutableSetIterable vs MutableSet. I suppose we could keep it as is and add the other interfaces only if we add other multi-reader implementations.
{ | ||
void withReadLockAndDelegate(Procedure<MutableBag<T>> procedure); | ||
|
||
void withWriteLockAndDelegate(Procedure<MutableBag<T>> procedure); |
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.
All usages of Procedure
should be generified. IntelliJ may show a warning and an auto-fix here in newish versions of IntelliJ. Specifically:
void withReadLockAndDelegate(Procedure<? super MutableBag<T>> procedure);
void withWriteLockAndDelegate(Procedure<? super MutableBag<T>> procedure);
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'm not sure about this actually. I realized this API is older and you just pulled it up to an interface.
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.
yes, that is indeed what happened - I have now got my forked repo up to date now and corrected the above
Signed-off-by: canthonyl <cheung.yi.lung@gmail.com>
hi please find this PR for #705