stefanvodita commented on code in PR #12010:
URL: https://github.com/apache/lucene/pull/12010#discussion_r1046013555


##########
lucene/misc/src/test/org/apache/lucene/misc/search/TestDocValuesStatsCollector.java:
##########
@@ -301,8 +301,8 @@ public void testDocsWithMultipleDoubleValues() throws 
IOException {
         if (stats.count() > 0) {
           DoubleSummaryStatistics sumStats =
               filterAndFlatValues(docValues, (v) -> v != 
null).summaryStatistics();
-          assertEquals(sumStats.getMax(), stats.max().longValue(), 0.00001);
-          assertEquals(sumStats.getMin(), stats.min().longValue(), 0.00001);
+          assertEquals(sumStats.getMax(), (double) stats.max().longValue(), 
0.00001);

Review Comment:
   `stats.max()` is already a `double` here, we could discard `longValue()`.



##########
lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java:
##########
@@ -594,7 +594,7 @@ public void testBasicDouble() throws Exception {
     DoubleDocValuesField field = new DoubleDocValuesField("field", 0.0);
     doc.add(field);
     for (long l = 0; l < 100; l++) {
-      field.setDoubleValue(l);
+      field.setDoubleValue((double) l);

Review Comment:
   Can `l` be an `int` instead and then there's no need for a cast since 
there's no loss of data? Same for lines 635-636.



##########
lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90PointsFormat.java:
##########
@@ -98,7 +98,8 @@ public void testMergeStability() throws Exception {
     super.testMergeStability();
   }
 
-  @SuppressWarnings("NarrowCalculation")
+  // TODO: clean up the math/estimation here rather than suppress so many 
warnings
+  @SuppressWarnings({"NarrowCalculation", "LongDoubleConversion"})

Review Comment:
   I think the only warnings in this file are asking to cast the arguments we 
pass to `Math.pow`. Why should we suppress that?



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to