You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by hi...@apache.org on 2019/07/24 23:17:11 UTC

[incubator-druid] branch master updated: Spotbugs: RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN (#8076)

This is an automated email from the ASF dual-hosted git repository.

himanshug pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 714a272  Spotbugs: RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN (#8076)
714a272 is described below

commit 714a2726a7878c13e8bf5049f841ee1d34f6f83d
Author: Fokko Driesprong <fo...@apache.org>
AuthorDate: Thu Jul 25 01:17:02 2019 +0200

    Spotbugs: RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN (#8076)
    
    * Spotbugs: RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN
    
    * Use Objects instead
---
 codestyle/spotbugs-exclude.xml                                          | 1 -
 .../java/org/apache/druid/query/metadata/metadata/SegmentAnalysis.java  | 2 +-
 processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java     | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/codestyle/spotbugs-exclude.xml b/codestyle/spotbugs-exclude.xml
index 44acdb8..eb112b2 100644
--- a/codestyle/spotbugs-exclude.xml
+++ b/codestyle/spotbugs-exclude.xml
@@ -75,7 +75,6 @@
     <Bug pattern="OS_OPEN_STREAM"/>
     <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
     <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
-    <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN"/>
     <Bug pattern="REC_CATCH_EXCEPTION"/>
     <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
     <Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/>
diff --git a/processing/src/main/java/org/apache/druid/query/metadata/metadata/SegmentAnalysis.java b/processing/src/main/java/org/apache/druid/query/metadata/metadata/SegmentAnalysis.java
index 726d51e..5b97cea 100644
--- a/processing/src/main/java/org/apache/druid/query/metadata/metadata/SegmentAnalysis.java
+++ b/processing/src/main/java/org/apache/druid/query/metadata/metadata/SegmentAnalysis.java
@@ -159,7 +159,7 @@ public class SegmentAnalysis implements Comparable<SegmentAnalysis>
     SegmentAnalysis that = (SegmentAnalysis) o;
     return size == that.size &&
            numRows == that.numRows &&
-           rollup == that.rollup &&
+           Objects.equals(rollup, that.rollup) &&
            Objects.equals(id, that.id) &&
            Objects.equals(interval, that.interval) &&
            Objects.equals(columns, that.columns) &&
diff --git a/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java b/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java
index 3f6d407..7b314ce 100644
--- a/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java
+++ b/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java
@@ -312,7 +312,7 @@ public class ScanQuery extends BaseQuery<ScanResultValue>
     final ScanQuery scanQuery = (ScanQuery) o;
     return batchSize == scanQuery.batchSize &&
            limit == scanQuery.limit &&
-           legacy == scanQuery.legacy &&
+           Objects.equals(legacy, scanQuery.legacy) &&
            Objects.equals(virtualColumns, scanQuery.virtualColumns) &&
            Objects.equals(resultFormat, scanQuery.resultFormat) &&
            Objects.equals(dimFilter, scanQuery.dimFilter) &&


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org