mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +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:
@@ -46,7 +46,6 @@ public class VideoEvent {
|
||||
* @param kind The numerical representation of kind
|
||||
* @return The kind
|
||||
*/
|
||||
@SuppressWarnings("PMD.CyclomaticComplexity")
|
||||
public static Kind getKindFromInt(int kind) {
|
||||
switch (kind) {
|
||||
case 0x0001:
|
||||
@@ -92,7 +91,6 @@ public class VideoEvent {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("PMD.ExcessiveParameterList")
|
||||
VideoEvent(
|
||||
int kind,
|
||||
int source,
|
||||
|
||||
@@ -112,7 +112,6 @@ public class VideoSink implements AutoCloseable {
|
||||
}
|
||||
|
||||
/** Enumerate all properties of this sink. */
|
||||
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
|
||||
public VideoProperty[] enumerateProperties() {
|
||||
int[] handles = CameraServerJNI.enumerateSinkProperties(m_handle);
|
||||
VideoProperty[] rv = new VideoProperty[handles.length];
|
||||
@@ -195,7 +194,6 @@ public class VideoSink implements AutoCloseable {
|
||||
*
|
||||
* @return Vector of sinks.
|
||||
*/
|
||||
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
|
||||
public static VideoSink[] enumerateSinks() {
|
||||
int[] handles = CameraServerJNI.enumerateSinks();
|
||||
VideoSink[] rv = new VideoSink[handles.length];
|
||||
|
||||
@@ -179,7 +179,6 @@ public class VideoSource implements AutoCloseable {
|
||||
}
|
||||
|
||||
/** Enumerate all properties of this source. */
|
||||
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
|
||||
public VideoProperty[] enumerateProperties() {
|
||||
int[] handles = CameraServerJNI.enumerateSourceProperties(m_handle);
|
||||
VideoProperty[] rv = new VideoProperty[handles.length];
|
||||
@@ -323,7 +322,6 @@ public class VideoSource implements AutoCloseable {
|
||||
*
|
||||
* @return Vector of sinks.
|
||||
*/
|
||||
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
|
||||
public VideoSink[] enumerateSinks() {
|
||||
int[] handles = CameraServerJNI.enumerateSourceSinks(m_handle);
|
||||
VideoSink[] rv = new VideoSink[handles.length];
|
||||
@@ -338,7 +336,6 @@ public class VideoSource implements AutoCloseable {
|
||||
*
|
||||
* @return Vector of sources.
|
||||
*/
|
||||
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
|
||||
public static VideoSource[] enumerateSources() {
|
||||
int[] handles = CameraServerJNI.enumerateSources();
|
||||
VideoSource[] rv = new VideoSource[handles.length];
|
||||
|
||||
Reference in New Issue
Block a user