mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Update and enable PMD 6.3.0 (#1107)
This commit is contained in:
committed by
Peter Johnson
parent
8eafe7f325
commit
e548a5f705
@@ -9,11 +9,12 @@ package edu.wpi.first.wpiutil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class RuntimeDetector {
|
||||
public final class RuntimeDetector {
|
||||
private static String filePrefix;
|
||||
private static String fileExtension;
|
||||
private static String filePath;
|
||||
|
||||
@SuppressWarnings("PMD.CyclomaticComplexity")
|
||||
private static synchronized void computePlatform() {
|
||||
if (fileExtension != null && filePath != null && filePrefix != null) {
|
||||
return;
|
||||
@@ -52,7 +53,7 @@ public class RuntimeDetector {
|
||||
filePath = "/linux/nativearm/";
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("Failed to determine OS");
|
||||
throw new IllegalStateException("Failed to determine OS");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,11 +113,15 @@ public class RuntimeDetector {
|
||||
|
||||
public static boolean is32BitIntel() {
|
||||
String arch = System.getProperty("os.arch");
|
||||
return arch.equals("x86") || arch.equals("i386");
|
||||
return "x86".equals(arch) || "i386".equals(arch);
|
||||
}
|
||||
|
||||
public static boolean is64BitIntel() {
|
||||
String arch = System.getProperty("os.arch");
|
||||
return arch.equals("amd64") || arch.equals("x86_64");
|
||||
return "amd64".equals(arch) || "x86_64".equals(arch);
|
||||
}
|
||||
|
||||
private RuntimeDetector() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user