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 "mbaedke (via GitHub)" <gi...@apache.org> on 2025/03/07 09:55:07 UTC
Re: [PR] OAK-11557 : removed usage of Guava's Iterables.getOnlyElements with S… [jackrabbit-oak]
mbaedke commented on code in PR #2147:
URL: https://github.com/apache/jackrabbit-oak/pull/2147#discussion_r1984775874
##########
oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java:
##########
@@ -3123,7 +3125,8 @@ private String explain(String query){
private String explainXpath(String query) throws ParseException {
String explain = "explain " + query;
Result result = executeQuery(explain, "xpath", NO_BINDINGS);
- ResultRow row = Iterables.getOnlyElement(result.getRows());
+ Assert.assertEquals(1, StreamUtils.toStream(result.getRows()).count());
Review Comment:
It's an explain query, so there should only be one row. If for some reason there are more, this might be expensive, no?
--
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