Skip to content

Commit

Permalink
Fix and/or filter some SpotBugs
Browse files Browse the repository at this point in the history
  • Loading branch information
leerho committed Jan 15, 2020
1 parent 2b8bb61 commit f14def3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/apache/datasketches/hll/TgtHllType.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
@SuppressWarnings("javadoc")
public enum TgtHllType { HLL_4, HLL_6, HLL_8;

public static final TgtHllType values[] = values();
private static final TgtHllType values[] = values();

public static final TgtHllType fromOrdinal(final int typeId) {
return values[typeId];
Expand Down
7 changes: 2 additions & 5 deletions src/test/java/org/apache/datasketches/hll/IsomorphicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
@SuppressWarnings({"javadoc", "unused"})
public class IsomorphicTest {
long v = 0;
final int maxLgK = 12;
HllSketch source;
Union union;

@Test
//Merges a type1 to an empty union (heap, HLL_8), and gets result as type1, checks binary equivalence
Expand Down Expand Up @@ -227,15 +224,15 @@ public void isomorphicHllMerges2() {
bytesOut6 = u.getResult(HLL_8).toUpdatableByteArray();//should be identical except for HllAccum

comb = "LgK: " + lgK + ", SkType: HLL_6, Compared with SkType HLL_8";
checkArrays(bytesOut8, bytesOut6, comb, true);
checkArrays(bytesOut8, bytesOut6, comb, false);

u = buildHeapUnionHllMode(lgK, 0);
sk = buildHeapSketchHllMode(lgK, HLL_4, 1 << lgK);
u.update(sk);
bytesOut4 = u.getResult(HLL_8).toUpdatableByteArray();//should be identical except for HllAccum

comb = "LgK: " + lgK + ", SkType: HLL_4, Compared with SkType HLL_8";
checkArrays(bytesOut8, bytesOut4, comb, true);
checkArrays(bytesOut8, bytesOut4, comb, false);
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/test/java/org/apache/datasketches/hll/UnionCaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@
*/
@SuppressWarnings("javadoc")
public class UnionCaseTest {
private static final String LS = System.getProperty("line.separator");
long v = 0;
final int maxLgK = 12;
final static int maxLgK = 12;
HllSketch source;
Union union;
String hfmt = "%10s%10s%10s%10s%10s%10s%10s%10s%10s%10s%10s\n";
//Union union;
String hfmt = "%10s%10s%10s%10s%10s%10s%10s%10s%10s%10s%10s" + LS;
String hdr = String.format(hfmt, "caseNum","srcLgKStr","gdtLgKStr","srcType","gdtType",
"srcMem","gdtMem","srcMode","gdtMode","srcOoof","gdtOoof");

Expand Down
14 changes: 14 additions & 0 deletions tools/FindBugsExcludeFilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ under the License.
<Class name="~.*\.*Test" />
</Match>

<Match>
<Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS" />
<Class name="~.*\.Group" />
</Match>

<Match>
<Bug pattern="VO_VOLATILE_INCREMENT" />
<Class name="~.*\.Concurrent.+QuickSelectSketch" />
</Match>

<Match>
<Class name="~.*\.TestAllTest" />
</Match>

<Match> <!-- Exclude for test classes; too many False Positives. -->
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" />
<Class name="~.*\.*Test" />
Expand Down

0 comments on commit f14def3

Please sign in to comment.