Skip to content

Commit

Permalink
errorprone :: InitializeInline (#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-mlb committed May 29, 2024
1 parent 906d8c0 commit 61acbb5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/main/java/emissary/kff/KffMemcached.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ public boolean check(String id, ChecksumResults sums) throws Exception {

// Send the query
Future<Object> future = client.asyncGet(key);
Object result;


// Let the TimeoutException propagate up
result = future.get(opTimeoutMillis, TimeUnit.MILLISECONDS);
Object result = future.get(opTimeoutMillis, TimeUnit.MILLISECONDS);

if (result != null) {
if (storeIdDupe) {
Expand Down
9 changes: 1 addition & 8 deletions src/main/java/emissary/util/Entropy.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
$Id$
*/


package emissary.util;

public class Entropy {
Expand All @@ -16,12 +11,10 @@ public static boolean checkText(final byte[] data) {

public static boolean checkText(final byte[] data, int length) {
int bytes = 0;
int[] histogramArray;
double entropy = 0;
double relativeFreq;
int size = Math.min(length, data.length);

histogramArray = new int[256];
int[] histogramArray = new int[256];


// ******************************************************************
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/emissary/util/search/ByteMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,12 @@ public int indexIgnoreCase(byte[] pattern, int beginIndex, int endIndex) {
return NOTFOUND;
}

int matchPos;

// Use the Boyer-Moore scanner. Set it to
// ignore case.

scanner.setCaseSensitive(false);
matchPos = scanner.indexOf(pattern, beginIndex, endIndex);
int matchPos = scanner.indexOf(pattern, beginIndex, endIndex);

// Reset scanner to default state.
scanner.setCaseSensitive(true);
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/emissary/output/DropOffUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,7 @@ private static void setupMetadata(IBaseDataObject bdo, String fieldValue, DropOf
}

private static void testFileType(IBaseDataObject bdo, @Nullable Map<String, String> metadata, String expectedResults, @Nullable String formsArg) {
String fileType;
fileType = DropOffUtil.getAndPutFileType(bdo, metadata, formsArg);
String fileType = DropOffUtil.getAndPutFileType(bdo, metadata, formsArg);
assertEquals(expectedResults, fileType);
}
}
3 changes: 1 addition & 2 deletions src/test/java/emissary/util/io/ResourceReaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ void testResourceLocation() {
// Make sure we built the resource names correctly
// by opening each one as a stream
for (String rez : resources) {
InputStream is;
is = rr.getResourceAsStream(rez);
InputStream is = rr.getResourceAsStream(rez);
assertNotNull(is, "Failed to open " + rez);
try {
is.close();
Expand Down

0 comments on commit 61acbb5

Please sign in to comment.