Skip to content

Commit ee84291

Browse files
authored
Merge pull request #449 from apache/fix_spotbugs
Some newly detected SpotBugs issues resolved.
2 parents 5c3746e + 0b2e6c1 commit ee84291

5 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/main/java/org/apache/datasketches/sampling/ReservoirItemsSketch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public static <T> ReservoirItemsSketch<T> heapify(final Memory srcMem,
223223
final boolean preLongsEqMin = (numPreLongs == Family.RESERVOIR.getMinPreLongs());
224224
final boolean preLongsEqMax = (numPreLongs == Family.RESERVOIR.getMaxPreLongs());
225225

226-
if (!preLongsEqMin & !preLongsEqMax) {
226+
if (!preLongsEqMin && !preLongsEqMax) {
227227
throw new SketchesArgumentException(
228228
"Possible corruption: Non-empty sketch with only "
229229
+ Family.RESERVOIR.getMinPreLongs() + " preLong(s)");

src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static <T> ReservoirItemsUnion<T> heapify(final Memory srcMem,
104104
final boolean preLongsEqMin = (numPreLongs == Family.RESERVOIR_UNION.getMinPreLongs());
105105
final boolean preLongsEqMax = (numPreLongs == Family.RESERVOIR_UNION.getMaxPreLongs());
106106

107-
if (!preLongsEqMin & !preLongsEqMax) {
107+
if (!preLongsEqMin && !preLongsEqMax) {
108108
throw new SketchesArgumentException("Possible corruption: Non-empty union with only "
109109
+ Family.RESERVOIR_UNION.getMinPreLongs() + "preLongs");
110110
}

src/main/java/org/apache/datasketches/sampling/ReservoirLongsSketch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public static ReservoirLongsSketch heapify(final Memory srcMem) {
204204
final boolean preLongsEqMin = (numPreLongs == Family.RESERVOIR.getMinPreLongs());
205205
final boolean preLongsEqMax = (numPreLongs == Family.RESERVOIR.getMaxPreLongs());
206206

207-
if (!preLongsEqMin & !preLongsEqMax) {
207+
if (!preLongsEqMin && !preLongsEqMax) {
208208
throw new SketchesArgumentException("Possible corruption: Non-empty sketch with only "
209209
+ Family.RESERVOIR.getMinPreLongs() + "preLongs");
210210
}

src/main/java/org/apache/datasketches/sampling/ReservoirLongsUnion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static ReservoirLongsUnion heapify(final Memory srcMem) {
9595
final boolean preLongsEqMin = (numPreLongs == Family.RESERVOIR_UNION.getMinPreLongs());
9696
final boolean preLongsEqMax = (numPreLongs == Family.RESERVOIR_UNION.getMaxPreLongs());
9797

98-
if (!preLongsEqMin & !preLongsEqMax) {
98+
if (!preLongsEqMin && !preLongsEqMax) {
9999
throw new SketchesArgumentException("Possible corruption: Non-empty union with only "
100100
+ Family.RESERVOIR_UNION.getMinPreLongs() + "preLongs");
101101
}

src/main/java/org/apache/datasketches/theta/CompactOperations.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ static CompactSketch memoryToCompact(
123123
final int srcPreLongs = extractPreLongs(srcMem);
124124
final int srcSerVer = extractSerVer(srcMem); //not used
125125
final int srcFamId = extractFamilyID(srcMem);
126-
final Family srcFamily = Family.idToFamily(srcFamId);
127126
final int srcLgArrLongs = extractLgArrLongs(srcMem);
128127
final int srcFlags = extractFlags(srcMem);
129128
final short srcSeedHash = (short) extractSeedHash(srcMem);

0 commit comments

Comments
 (0)