Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public boolean equalToReference(Tuple2<Long, String> candidate) {
public int compareToReference(Tuple2<Long, String> candidate) {
long x = ref;
long y = candidate.f0;
return (x < y) ? -1 : ((x == y) ? 0 : 1);
return Long.compare(x, y);
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public boolean equalToReference(Tuple2<Long, byte[]> candidate) {
public int compareToReference(Tuple2<Long, byte[]> candidate) {
long x = ref;
long y = candidate.f0;
return (x < y) ? -1 : ((x == y) ? 0 : 1);
return Long.compare(x, y);
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public boolean equalToReference(Tuple2<Long, String> candidate) {
public int compareToReference(Tuple2<Long, String> candidate) {
long x = ref;
long y = candidate.f0;
return (x < y) ? -1 : ((x == y) ? 0 : 1);
return Long.compare(x, y);
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public boolean equalToReference(Tuple2<Long, byte[]> candidate) {
public int compareToReference(Tuple2<Long, byte[]> candidate) {
long x = ref;
long y = candidate.f0;
return (x < y) ? -1 : ((x == y) ? 0 : 1);
return Long.compare(x, y);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,7 @@ private File generateFileWithStrings(int numStrings, String prefix) throws IOExc
bld.append(prefix);

File f = File.createTempFile("strings", "txt");
BufferedWriter wrt = null;
try {
wrt = new BufferedWriter(new FileWriter(f));
try (BufferedWriter wrt = new BufferedWriter(new FileWriter(f))) {
Copy link
Copy Markdown
Contributor

@spuru9 spuru9 Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though not related to the file but it would be nice to have this change in

and as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @spuru9 .
Nice catch!
Updated


for (int i = 0; i < numStrings; i++) {
bld.setLength(resetValue);
Expand All @@ -380,8 +378,6 @@ private File generateFileWithStrings(int numStrings, String prefix) throws IOExc
wrt.write(str);
wrt.newLine();
}
} finally {
wrt.close();
}

return f;
Expand All @@ -393,9 +389,7 @@ private File generateFileWithStringTuples(int numStrings, String prefix) throws
final StringBuilder bld = new StringBuilder();

File f = File.createTempFile("strings", "txt");
BufferedWriter wrt = null;
try {
wrt = new BufferedWriter(new FileWriter(f));
try (BufferedWriter wrt = new BufferedWriter(new FileWriter(f))) {

for (int i = 0; i < numStrings; i++) {
bld.setLength(0);
Expand All @@ -420,8 +414,6 @@ private File generateFileWithStringTuples(int numStrings, String prefix) throws
wrt.write(str);
wrt.newLine();
}
} finally {
wrt.close();
}

return f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,7 @@ private File generateFileWithStrings(int numStrings, String prefix) throws IOExc
bld.append(prefix);

File f = File.createTempFile("strings", "txt");
BufferedWriter wrt = null;
try {
wrt = new BufferedWriter(new FileWriter(f));
try (BufferedWriter wrt = new BufferedWriter(new FileWriter(f))) {

for (int i = 0; i < numStrings; i++) {
bld.setLength(resetValue);
Expand All @@ -406,10 +404,6 @@ private File generateFileWithStrings(int numStrings, String prefix) throws IOExc
wrt.write(str);
wrt.newLine();
}
} finally {
if (wrt != null) {
wrt.close();
}
}

return f;
Expand All @@ -421,9 +415,7 @@ private File generateFileWithStringTuples(int numStrings, String prefix) throws
final StringBuilder bld = new StringBuilder();

File f = File.createTempFile("strings", "txt");
BufferedWriter wrt = null;
try {
wrt = new BufferedWriter(new FileWriter(f));
try (BufferedWriter wrt = new BufferedWriter(new FileWriter(f))) {

for (int i = 0; i < numStrings; i++) {
bld.setLength(0);
Expand All @@ -448,10 +440,6 @@ private File generateFileWithStringTuples(int numStrings, String prefix) throws
wrt.write(str);
wrt.newLine();
}
} finally {
if (wrt != null) {
wrt.close();
}
}

return f;
Expand Down