Update and enable PMD 6.3.0 (#1107)

This commit is contained in:
Austin Shalit
2018-06-03 10:00:53 -07:00
committed by Peter Johnson
parent 8eafe7f325
commit e548a5f705
156 changed files with 619 additions and 325 deletions

View File

@@ -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() {
}
}