[build] Upgrade to PMD 7.2.0 (#6718)

This commit is contained in:
Gold856
2024-06-09 01:08:23 -04:00
committed by GitHub
parent e2dcbd016d
commit b0cc84a9c7
64 changed files with 148 additions and 183 deletions

View File

@@ -942,14 +942,7 @@ public final class NetworkTableEntry implements Publisher, Subscriber {
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if (!(other instanceof NetworkTableEntry)) {
return false;
}
return m_handle == ((NetworkTableEntry) other).m_handle;
return other == this || other instanceof NetworkTableEntry entry && m_handle == entry.m_handle;
}
@Override

View File

@@ -43,7 +43,6 @@ import us.hebi.quickbuf.ProtoMessage;
* kept to the NetworkTableInstance returned by this function to keep it from being garbage
* collected.
*/
@SuppressWarnings("PMD.CouplingBetweenObjects")
public final class NetworkTableInstance implements AutoCloseable {
/** Client/server mode flag values (as returned by {@link #getNetworkMode()}). */
public enum NetworkMode {
@@ -773,7 +772,10 @@ public final class NetworkTableInstance implements AutoCloseable {
private static class ListenerStorage implements AutoCloseable {
private final ReentrantLock m_lock = new ReentrantLock();
private final Map<Integer, Consumer<NetworkTableEvent>> m_listeners = new HashMap<>();
@SuppressWarnings("PMD.SingularField")
private Thread m_thread;
private int m_poller;
private boolean m_waitQueue;
private final Event m_waitQueueEvent = new Event();
@@ -1519,10 +1521,7 @@ public final class NetworkTableInstance implements AutoCloseable {
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
return other instanceof NetworkTableInstance inst && m_handle == inst.m_handle;
return other == this || other instanceof NetworkTableInstance inst && m_handle == inst.m_handle;
}
@Override

View File

@@ -646,12 +646,10 @@ public final class NetworkTableValue {
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
return other instanceof NetworkTableValue ntOther
&& m_type == ntOther.m_type
&& m_value.equals(ntOther.m_value);
return other == this
|| other instanceof NetworkTableValue ntOther
&& m_type == ntOther.m_type
&& m_value.equals(ntOther.m_value);
}
@Override