Skip to content

Commit b54c342

Browse files
authored
Merge pull request #249 from DataSketches/FixFindBugs
Fix find bugs
2 parents 17c864d + 6e9160a commit b54c342

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/main/java/com/yahoo/sketches/cpc/CompressedState.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,12 @@
4242
*/
4343
final class CompressedState {
4444
private static final String LS = System.getProperty("line.separator");
45+
private boolean csvIsValid = false;
46+
private boolean windowIsValid = false;
4547
final int lgK;
4648
final short seedHash;
4749
int fiCol = 0;
4850
boolean mergeFlag = false; //compliment of HIP Flag
49-
boolean csvIsValid = false;
50-
boolean windowIsValid = false;
51-
5251
long numCoupons = 0;
5352

5453
double kxp;
@@ -60,7 +59,7 @@ final class CompressedState {
6059
int[] cwStream = null; //may be longer than required
6160
int cwLengthInts = 0;
6261

63-
int cpcRequiredBytes = 0;
62+
//int cpcRequiredBytes = 0;
6463

6564
private CompressedState(final int lgK, final short seedHash) {
6665
this.lgK = lgK;

src/main/java/com/yahoo/sketches/theta/CompactSketch.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ static final long[] compactCachePart(final long[] srcCache, final int lgArrLongs
120120
return cacheOut;
121121
}
122122

123+
//compactCache and dstMem must be valid
123124
static final Memory loadCompactMemory(final long[] compactCache, final short seedHash,
124125
final int curCount, final long thetaLong, final WritableMemory dstMem,
125126
final byte flags, final int preLongs) {
@@ -152,7 +153,7 @@ static final Memory loadCompactMemory(final long[] compactCache, final short see
152153
if (preLongs > 2) {
153154
insertThetaLong(dstMem, thetaLong);
154155
}
155-
if ((compactCache != null) && (curCount > 0)) {
156+
if (curCount > 0) {
156157
dstMem.putLongArray(preLongs << 3, compactCache, 0, curCount);
157158
}
158159
return dstMem;

src/main/java/com/yahoo/sketches/theta/ConcurrentDirectQuickSelectSketch.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ private void advanceEpoch() {
241241
ConcurrentPropagationService.resetExecutorService(Thread.currentThread().getId());
242242
//noinspection NonAtomicOperationOnVolatileField
243243
// this increment of a volatile field is done within the scope of the propagation
244-
// synchronization and hence is done by a single thread
244+
// synchronization and hence is done by a single thread.
245+
// Ignore a FindBugs warning
245246
epoch_++;
246247
endPropagation(null, true);
247248
initBgPropagationService();

src/main/java/com/yahoo/sketches/theta/ConcurrentHeapQuickSelectSketch.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ private void advanceEpoch() {
239239
//noinspection NonAtomicOperationOnVolatileField
240240
// this increment of a volatile field is done within the scope of the propagation
241241
// synchronization and hence is done by a single thread
242+
// Ignore a FindBugs warning
242243
epoch_++;
243244
endPropagation(null, true);
244245
initBgPropagationService();

0 commit comments

Comments
 (0)