mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Disable frivolous PMD warnings and enable PMD in ntcore (#3419)
Some valid warnings like throwing NullPointerException or using a for loop instead of System.arraycopy() were fixed. Abstract classes marked with PMD.AbstractClassWithoutAbstractMethod were made concrete because they already had protected constructors. Fixes #1697.
This commit is contained in:
@@ -56,11 +56,7 @@ public final class CombinedRuntimeLoader {
|
||||
* @return List of all libraries that were extracted
|
||||
* @throws IOException Thrown if resource not found or file could not be extracted
|
||||
*/
|
||||
@SuppressWarnings({
|
||||
"PMD.AvoidInstantiatingObjectsInLoops",
|
||||
"PMD.UnnecessaryCastRule",
|
||||
"unchecked"
|
||||
})
|
||||
@SuppressWarnings({"PMD.UnnecessaryCastRule", "unchecked"})
|
||||
public static <T> List<String> extractLibraries(Class<T> clazz, String resourceName)
|
||||
throws IOException {
|
||||
TypeReference<HashMap<String, Object>> typeRef =
|
||||
|
||||
@@ -15,7 +15,6 @@ public final class RuntimeDetector {
|
||||
private static String fileExtension;
|
||||
private static String filePath;
|
||||
|
||||
@SuppressWarnings("PMD.CyclomaticComplexity")
|
||||
private static synchronized void computePlatform() {
|
||||
if (fileExtension != null && filePath != null && filePrefix != null) {
|
||||
return;
|
||||
|
||||
@@ -107,13 +107,7 @@ public final class RuntimeLoader<T> {
|
||||
}
|
||||
|
||||
/** Load a native library by directly hashing the file. */
|
||||
@SuppressWarnings({
|
||||
"PMD.NPathComplexity",
|
||||
"PMD.PreserveStackTrace",
|
||||
"PMD.EmptyWhileStmt",
|
||||
"PMD.AvoidThrowingRawExceptionTypes",
|
||||
"PMD.CyclomaticComplexity"
|
||||
})
|
||||
@SuppressWarnings({"PMD.PreserveStackTrace", "PMD.EmptyWhileStmt"})
|
||||
public void loadLibraryHashed() throws IOException {
|
||||
try {
|
||||
// First, try loading path
|
||||
|
||||
Reference in New Issue
Block a user