thomasmueller commented on code in PR #2746:
URL: https://github.com/apache/jackrabbit-oak/pull/2746#discussion_r2852346106


##########
oak-core/src/test/java/org/apache/jackrabbit/oak/query/UnionQueryTest.java:
##########
@@ -512,12 +552,19 @@ public MockQueryBuilder(boolean hasScore) {
         }
 
         public MockQueryBuilder addResult(String path, double score) {
+            if (!hasScore) {
+                throw new IllegalStateException("Cannot provide score");
+            }
+            return addResult(path, Double.valueOf(score));
+        }
+
+        public MockQueryBuilder addResult(String path, Double score) {
             if (!hasScore) {
                 throw new IllegalStateException("Cannot provide score");
             }
             PropertyValue[] values = new PropertyValue[] {
                     PropertyValues.newString(path),
-                    PropertyValues.newDouble(score)
+                    score == null ? null : PropertyValues.newDouble(score)

Review Comment:
   This looks wrong to me. What about:
   
   ```suggestion
                       PropertyValues.newDouble(score == null ? 0.0 : score)
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to