Browse Source

NativeUtil: Fix errorprone warnings

pull/270/head
weisj 3 years ago
parent
commit
9db99c8c18
No known key found for this signature in database
GPG Key ID: 31124CB75461DA2A
  1. 4
      native-utils/build.gradle.kts
  2. 1
      native-utils/src/main/java/com/github/weisj/darklaf/nativeutil/AbstractLibrary.java
  3. 7
      native-utils/src/main/java/com/github/weisj/darklaf/nativeutil/NativeUtil.java

4
native-utils/build.gradle.kts

@ -6,10 +6,6 @@ plugins {
`module-info-compile`
}
dependencies {
implementation(projects.darklafUtils)
}
tasks.jar {
CrLfSpec(LineEndings.LF).run {
into("META-INF") {

1
native-utils/src/main/java/com/github/weisj/darklaf/nativeutil/AbstractLibrary.java

@ -26,7 +26,6 @@ import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
public abstract class AbstractLibrary {
private final String name;

7
native-utils/src/main/java/com/github/weisj/darklaf/nativeutil/NativeUtil.java

@ -29,6 +29,9 @@ import java.nio.file.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* A simple library class which helps with loading dynamic libraries stored in the JAR archive.
@ -42,6 +45,7 @@ import java.util.Objects;
*/
public final class NativeUtil {
private static final Logger LOGGER = Logger.getLogger(NativeUtil.class.getName());
public static final String NATIVE_FOLDER_PATH_PREFIX = "nativeutils";
/**
* The minimum length a prefix for a file has to have according to
@ -200,7 +204,8 @@ public final class NativeUtil {
private static void delete(final Path path) {
try {
Files.deleteIfExists(path);
} catch (final IOException ignored) {
} catch (final IOException e) {
LOGGER.log(Level.WARNING, "Couldn't delete file " + path, e);
}
}

Loading…
Cancel
Save