You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "reschke (via GitHub)" <gi...@apache.org> on 2024/09/09 12:39:09 UTC
[PR] OAK-11097: remove remaining use of Guava predicates [jackrabbit-oak]
reschke opened a new pull request, #1704:
URL: https://github.com/apache/jackrabbit-oak/pull/1704
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11097: remove remaining use of Guava predicates [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #1704:
URL: https://github.com/apache/jackrabbit-oak/pull/1704#discussion_r1750515929
##########
oak-it/src/test/java/org/apache/jackrabbit/oak/composite/CompositeNodeStoreTest.java:
##########
@@ -652,12 +650,14 @@ public void duplicatedChildren() throws CommitFailedException {
deepMountBuilder.child("new").setProperty("store", "deepMounted", Type.STRING);
deepMountedStore.merge(deepMountBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
- List<ChildNodeEntry> children = newArrayList(filter(store.getRoot().getChildNodeEntries(), compose(Predicates.equalTo("new"), GET_NAME::apply)));
+ List<ChildNodeEntry> children = newArrayList(filter(store.getRoot().getChildNodeEntries(),
+ x -> Objects.equals(x == null ? null : x.getName(), "new")));
Review Comment:
I *believe* we need "equals(null, null) -> true".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11097: remove remaining use of Guava predicates [jackrabbit-oak]
Posted by "nfsantos (via GitHub)" <gi...@apache.org>.
nfsantos commented on code in PR #1704:
URL: https://github.com/apache/jackrabbit-oak/pull/1704#discussion_r1750424030
##########
oak-it/src/test/java/org/apache/jackrabbit/oak/composite/CompositeNodeStoreTest.java:
##########
@@ -652,12 +650,14 @@ public void duplicatedChildren() throws CommitFailedException {
deepMountBuilder.child("new").setProperty("store", "deepMounted", Type.STRING);
deepMountedStore.merge(deepMountBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
- List<ChildNodeEntry> children = newArrayList(filter(store.getRoot().getChildNodeEntries(), compose(Predicates.equalTo("new"), GET_NAME::apply)));
+ List<ChildNodeEntry> children = newArrayList(filter(store.getRoot().getChildNodeEntries(),
+ x -> Objects.equals(x == null ? null : x.getName(), "new")));
Review Comment:
I find this confusing. Suggested alternative:
```
x -> x != null && Objects.equals(x.getName(), "new")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11097: remove remaining use of Guava predicates [jackrabbit-oak]
Posted by "nfsantos (via GitHub)" <gi...@apache.org>.
nfsantos commented on code in PR #1704:
URL: https://github.com/apache/jackrabbit-oak/pull/1704#discussion_r1753176654
##########
oak-it/src/test/java/org/apache/jackrabbit/oak/composite/CompositeNodeStoreTest.java:
##########
@@ -652,12 +650,14 @@ public void duplicatedChildren() throws CommitFailedException {
deepMountBuilder.child("new").setProperty("store", "deepMounted", Type.STRING);
deepMountedStore.merge(deepMountBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
- List<ChildNodeEntry> children = newArrayList(filter(store.getRoot().getChildNodeEntries(), compose(Predicates.equalTo("new"), GET_NAME::apply)));
+ List<ChildNodeEntry> children = newArrayList(filter(store.getRoot().getChildNodeEntries(),
+ x -> Objects.equals(x == null ? null : x.getName(), "new")));
Review Comment:
I think in this case the right-hand side is always "new", so if x == null, it will be false. Anyway, not too important, no need to change anything, but the fact that we are arguing over this line of code is a good indication that it is confusing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11097: remove remaining use of Guava predicates [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke merged PR #1704:
URL: https://github.com/apache/jackrabbit-oak/pull/1704
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org