mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[build] Enable spotbugs (#3601)
Benign spotbugs warnings were suppressed, and all others were fixed. Bug descriptions are documented here: https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html Co-authored-by: Austin Shalit <austinshalit@gmail.com>
This commit is contained in:
@@ -105,7 +105,13 @@ public final class RuntimeLoader<T> {
|
||||
if (resIs == null) {
|
||||
throw new IOException(getLoadErrorMessage(ule));
|
||||
}
|
||||
jniLibrary.getParentFile().mkdirs();
|
||||
|
||||
var parentFile = jniLibrary.getParentFile();
|
||||
if (parentFile == null) {
|
||||
throw new IOException("JNI library has no parent file");
|
||||
}
|
||||
parentFile.mkdirs();
|
||||
|
||||
try (OutputStream os = Files.newOutputStream(jniLibrary.toPath())) {
|
||||
byte[] buffer = new byte[0xFFFF]; // 64K copy buffer
|
||||
int readBytes;
|
||||
@@ -171,7 +177,13 @@ public final class RuntimeLoader<T> {
|
||||
if (resIs == null) {
|
||||
throw new IOException(getLoadErrorMessage(ule));
|
||||
}
|
||||
jniLibrary.getParentFile().mkdirs();
|
||||
|
||||
var parentFile = jniLibrary.getParentFile();
|
||||
if (parentFile == null) {
|
||||
throw new IOException("JNI library has no parent file");
|
||||
}
|
||||
parentFile.mkdirs();
|
||||
|
||||
try (OutputStream os = Files.newOutputStream(jniLibrary.toPath())) {
|
||||
byte[] buffer = new byte[0xFFFF]; // 64K copy buffer
|
||||
int readBytes;
|
||||
|
||||
Reference in New Issue
Block a user