Clean up Java warning suppressions (#4433)

Checkstyle naming conventions were changed to allow most of what's in
wpimath. Naming rules were disabled completely in wpimath since almost
all suppressions are for math notation.
This commit is contained in:
Tyler Veness
2022-09-24 00:13:55 -07:00
committed by GitHub
parent 17f504f548
commit a791470de7
233 changed files with 282 additions and 881 deletions

View File

@@ -5,34 +5,30 @@
package edu.wpi.first.networktables;
/** NetworkTables Connection information. */
@SuppressWarnings("MemberName")
public final class ConnectionInfo {
/**
* The remote identifier (as set on the remote node by {@link
* NetworkTableInstance#setNetworkIdentity(String)}).
*/
@SuppressWarnings("MemberName")
public final String remote_id;
/** The IP address of the remote node. */
@SuppressWarnings("MemberName")
public final String remote_ip;
/** The port number of the remote node. */
@SuppressWarnings("MemberName")
public final int remote_port;
/**
* The last time any update was received from the remote node (same scale as returned by {@link
* NetworkTablesJNI#now()}).
*/
@SuppressWarnings("MemberName")
public final long last_update;
/**
* The protocol version being used for this connection. This is in protocol layer format, so
* 0x0200 = 2.0, 0x0300 = 3.0).
*/
@SuppressWarnings("MemberName")
public final int protocol_version;
/**

View File

@@ -5,17 +5,15 @@
package edu.wpi.first.networktables;
/** NetworkTables Connection notification. */
@SuppressWarnings("MemberName")
public final class ConnectionNotification {
/** Listener that was triggered. */
@SuppressWarnings("MemberName")
public final int listener;
/** True if event is due to connection being established. */
@SuppressWarnings("MemberName")
public final boolean connected;
/** Connection information. */
@SuppressWarnings("MemberName")
public final ConnectionInfo conn;
/**

View File

@@ -5,25 +5,21 @@
package edu.wpi.first.networktables;
/** NetworkTables Entry information. */
@SuppressWarnings("MemberName")
public final class EntryInfo {
/** Entry handle. */
@SuppressWarnings("MemberName")
public final int entry;
/** Entry name. */
@SuppressWarnings("MemberName")
public final String name;
/** Entry type. */
@SuppressWarnings("MemberName")
public final NetworkTableType type;
/** Entry flags. */
@SuppressWarnings("MemberName")
public final int flags;
/** Timestamp of last change to entry (type or value). */
@SuppressWarnings("MemberName")
public final long last_change;
/**

View File

@@ -5,27 +5,23 @@
package edu.wpi.first.networktables;
/** NetworkTables Entry notification. */
@SuppressWarnings("MemberName")
public final class EntryNotification {
/** Listener that was triggered. */
@SuppressWarnings("MemberName")
public final int listener;
/** Entry handle. */
@SuppressWarnings("MemberName")
public final int entry;
/** Entry name. */
@SuppressWarnings("MemberName")
public final String name;
/** The new value. */
@SuppressWarnings("MemberName")
public final NetworkTableValue value;
/**
* Update flags. For example, {@link EntryListenerFlags#kNew} if the key did not previously exist.
*/
@SuppressWarnings("MemberName")
public final int flags;
/**

View File

@@ -5,6 +5,7 @@
package edu.wpi.first.networktables;
/** NetworkTables log message. */
@SuppressWarnings("MemberName")
public final class LogMessage {
/** Logging levels. */
public static final int kCritical = 50;
@@ -19,23 +20,18 @@ public final class LogMessage {
public static final int kDebug4 = 6;
/** The logger that generated the message. */
@SuppressWarnings("MemberName")
public final int logger;
/** Log level of the message. */
@SuppressWarnings("MemberName")
public final int level;
/** The filename of the source file that generated the message. */
@SuppressWarnings("MemberName")
public final String filename;
/** The line number in the source file that generated the message. */
@SuppressWarnings("MemberName")
public final int line;
/** The message. */
@SuppressWarnings("MemberName")
public final String message;
/**

View File

@@ -207,7 +207,6 @@ public final class NetworkTableInstance implements AutoCloseable {
private boolean m_entryListenerWaitQueue;
private final Condition m_entryListenerWaitQueueCond = m_entryListenerLock.newCondition();
@SuppressWarnings("PMD.AvoidCatchingThrowable")
private void startEntryListenerThread() {
var entryListenerThread =
new Thread(
@@ -375,7 +374,6 @@ public final class NetworkTableInstance implements AutoCloseable {
private final Condition m_connectionListenerWaitQueueCond =
m_connectionListenerLock.newCondition();
@SuppressWarnings("PMD.AvoidCatchingThrowable")
private void startConnectionListenerThread() {
var connectionListenerThread =
new Thread(
@@ -524,7 +522,6 @@ public final class NetworkTableInstance implements AutoCloseable {
private boolean m_rpcCallWaitQueue;
private final Condition m_rpcCallWaitQueueCond = m_rpcCallLock.newCondition();
@SuppressWarnings("PMD.AvoidCatchingThrowable")
private void startRpcCallThread() {
var rpcCallThread =
new Thread(
@@ -1048,7 +1045,6 @@ public final class NetworkTableInstance implements AutoCloseable {
private boolean m_loggerWaitQueue;
private final Condition m_loggerWaitQueueCond = m_loggerLock.newCondition();
@SuppressWarnings("PMD.AvoidCatchingThrowable")
private void startLogThread() {
var loggerThread =
new Thread(

View File

@@ -7,6 +7,7 @@ package edu.wpi.first.networktables;
import java.util.Objects;
/** A network table entry value. */
@SuppressWarnings("PMD.MethodReturnsInternalArray")
public final class NetworkTableValue {
NetworkTableValue(NetworkTableType type, Object value, long time) {
m_type = type;
@@ -183,7 +184,6 @@ public final class NetworkTableValue {
* @return The raw value.
* @throws ClassCastException if the entry value is not of raw type.
*/
@SuppressWarnings("PMD.MethodReturnsInternalArray")
public byte[] getRaw() {
if (m_type != NetworkTableType.kRaw) {
throw new ClassCastException("cannot convert " + m_type + " to raw");
@@ -197,7 +197,6 @@ public final class NetworkTableValue {
* @return The rpc definition value.
* @throws ClassCastException if the entry value is not of rpc definition type.
*/
@SuppressWarnings("PMD.MethodReturnsInternalArray")
public byte[] getRpc() {
if (m_type != NetworkTableType.kRpc) {
throw new ClassCastException("cannot convert " + m_type + " to rpc");
@@ -211,7 +210,6 @@ public final class NetworkTableValue {
* @return The boolean array value.
* @throws ClassCastException if the entry value is not of boolean array type.
*/
@SuppressWarnings("PMD.MethodReturnsInternalArray")
public boolean[] getBooleanArray() {
if (m_type != NetworkTableType.kBooleanArray) {
throw new ClassCastException("cannot convert " + m_type + " to boolean array");
@@ -225,7 +223,6 @@ public final class NetworkTableValue {
* @return The double array value.
* @throws ClassCastException if the entry value is not of double array type.
*/
@SuppressWarnings("PMD.MethodReturnsInternalArray")
public double[] getDoubleArray() {
if (m_type != NetworkTableType.kDoubleArray) {
throw new ClassCastException("cannot convert " + m_type + " to double array");
@@ -239,7 +236,6 @@ public final class NetworkTableValue {
* @return The string array value.
* @throws ClassCastException if the entry value is not of string array type.
*/
@SuppressWarnings("PMD.MethodReturnsInternalArray")
public String[] getStringArray() {
if (m_type != NetworkTableType.kStringArray) {
throw new ClassCastException("cannot convert " + m_type + " to string array");

View File

@@ -5,25 +5,21 @@
package edu.wpi.first.networktables;
/** NetworkTables Remote Procedure Call (Server Side). */
@SuppressWarnings("MemberName")
public final class RpcAnswer {
/** Entry handle. */
@SuppressWarnings("MemberName")
public final int entry;
/** Call handle. */
@SuppressWarnings("MemberName")
public int call;
/** Entry name. */
@SuppressWarnings("MemberName")
public final String name;
/** Call raw parameters. */
@SuppressWarnings("MemberName")
public final byte[] params;
/** Connection that called the RPC. */
@SuppressWarnings("MemberName")
public final ConnectionInfo conn;
/**