Ray Milkey
Committed by Gerrit Code Review

[Falcon] Fix SONAR flagged blocker issues

- add comments to suppress two instances where we really do want to catch Throwable
- implement equals() methods where only hashValue() was implemented

Change-Id: Iecfd66ff50fbd433977d1affd74f5f05d0a047e5
......@@ -264,6 +264,31 @@ public class EAP extends BasePacket {
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof EAP)) {
return false;
}
EAP that = (EAP) o;
if (this.code != that.code) {
return false;
}
if (this.identifier != that.identifier) {
return false;
}
if (this.length != that.length) {
return false;
}
if (this.type != that.type) {
return false;
}
return true;
}
@Override
public String toString() {
return toStringHelper(getClass())
.add("code", Byte.toString(code))
......
......@@ -148,6 +148,28 @@ public class EAPOL extends BasePacket {
return result;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof EAPOL)) {
return false;
}
EAPOL that = (EAPOL) o;
if (this.version != that.version) {
return false;
}
if (this.eapolType != that.eapolType) {
return false;
}
if (this.packetLength != that.packetLength) {
return false;
}
return true;
}
/**
* Deserializer for EAPOL packets.
*
......
......@@ -42,6 +42,8 @@ public class RetryingFunction<U, V> implements Function<U, V> {
this.maxDelayBetweenRetries = maxDelayBetweenRetries;
}
@SuppressWarnings("squid:S1181")
// Yes we really do want to catch Throwable
@Override
public V apply(U input) {
int retryAttempts = 0;
......
......@@ -106,6 +106,8 @@ public class NettyMessaging implements MessagingService {
protected char[] ksPwd;
protected char[] tsPwd;
@SuppressWarnings("squid:S1181")
// We really need to catch Throwable due to netty native epoll() handling
private void initEventLoopGroup() {
// try Epoll first and if that does work, use nio.
try {
......