From 714a2726a7878c13e8bf5049f841ee1d34f6f83d Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Thu, 25 Jul 2019 01:17:02 +0200 Subject: [PATCH] Spotbugs: RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN (#8076) * Spotbugs: RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN * Use Objects instead --- codestyle/spotbugs-exclude.xml | 1 - .../apache/druid/query/metadata/metadata/SegmentAnalysis.java | 2 +- .../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 44acdb862c1..eb112b2bf4e 100644 --- a/codestyle/spotbugs-exclude.xml +++ b/codestyle/spotbugs-exclude.xml @@ -75,7 +75,6 @@ - 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 726d51e1e86..5b97cea64be 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 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 3f6d4074ea7..7b314ce4570 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 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) &&