github-advanced-security[bot] commented on code in PR #15272:
URL: https://github.com/apache/druid/pull/15272#discussion_r1375159241


##########
processing/src/test/java/org/apache/druid/segment/filter/PredicateValueMatcherFactoryTest.java:
##########
@@ -157,6 +157,82 @@
     Assert.assertFalse(matcher.matches(false));
   }
 
+  @Test
+  public void testNumberProcessorMatchingValue()
+  {
+    Double num = 2.;

Review Comment:
   ## Boxed variable is never null
   
   The variable 'num' is only assigned values of primitive type and is never 
'null', but it is declared with the boxed type 'Double'.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/5938)



##########
processing/src/test/java/org/apache/druid/segment/filter/PredicateValueMatcherFactoryTest.java:
##########
@@ -157,6 +157,82 @@
     Assert.assertFalse(matcher.matches(false));
   }
 
+  @Test
+  public void testNumberProcessorMatchingValue()
+  {
+    Double num = 2.;
+    final TestColumnValueSelector<Number> columnValueSelector = 
TestColumnValueSelector.of(
+            Number.class,
+            ImmutableList.of(new Number() {
+              @Override
+              public int intValue()
+              {
+                return num.intValue();
+              }
+
+              @Override
+              public long longValue()
+              {
+                return num.longValue();
+              }
+
+              @Override
+              public float floatValue()
+              {
+                return num.floatValue();
+              }
+
+              @Override
+              public double doubleValue()
+              {
+                return num;
+              }
+            }),
+            DateTimes.nowUtc()
+    );
+    columnValueSelector.advance();
+    final ValueMatcher matcher = 
forSelector("2").makeComplexProcessor(columnValueSelector);
+    Assert.assertTrue(matcher.matches(false));
+  }
+
+  @Test
+  public void testNumberProcessorNotMatchingValue()
+  {
+    Double num = 2.;

Review Comment:
   ## Boxed variable is never null
   
   The variable 'num' is only assigned values of primitive type and is never 
'null', but it is declared with the boxed type 'Double'.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/5939)



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to