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
Showing
4 changed files
with
51 additions
and
0 deletions
| ... | @@ -264,6 +264,31 @@ public class EAP extends BasePacket { | ... | @@ -264,6 +264,31 @@ public class EAP extends BasePacket { |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | @Override | 266 | @Override |
| 267 | + public boolean equals(Object o) { | ||
| 268 | + if (this == o) { | ||
| 269 | + return true; | ||
| 270 | + } | ||
| 271 | + if (!(o instanceof EAP)) { | ||
| 272 | + return false; | ||
| 273 | + } | ||
| 274 | + EAP that = (EAP) o; | ||
| 275 | + | ||
| 276 | + if (this.code != that.code) { | ||
| 277 | + return false; | ||
| 278 | + } | ||
| 279 | + if (this.identifier != that.identifier) { | ||
| 280 | + return false; | ||
| 281 | + } | ||
| 282 | + if (this.length != that.length) { | ||
| 283 | + return false; | ||
| 284 | + } | ||
| 285 | + if (this.type != that.type) { | ||
| 286 | + return false; | ||
| 287 | + } | ||
| 288 | + return true; | ||
| 289 | + } | ||
| 290 | + | ||
| 291 | + @Override | ||
| 267 | public String toString() { | 292 | public String toString() { |
| 268 | return toStringHelper(getClass()) | 293 | return toStringHelper(getClass()) |
| 269 | .add("code", Byte.toString(code)) | 294 | .add("code", Byte.toString(code)) | ... | ... |
| ... | @@ -148,6 +148,28 @@ public class EAPOL extends BasePacket { | ... | @@ -148,6 +148,28 @@ public class EAPOL extends BasePacket { |
| 148 | return result; | 148 | return result; |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | + @Override | ||
| 152 | + public boolean equals(Object o) { | ||
| 153 | + if (this == o) { | ||
| 154 | + return true; | ||
| 155 | + } | ||
| 156 | + if (!(o instanceof EAPOL)) { | ||
| 157 | + return false; | ||
| 158 | + } | ||
| 159 | + EAPOL that = (EAPOL) o; | ||
| 160 | + | ||
| 161 | + if (this.version != that.version) { | ||
| 162 | + return false; | ||
| 163 | + } | ||
| 164 | + if (this.eapolType != that.eapolType) { | ||
| 165 | + return false; | ||
| 166 | + } | ||
| 167 | + if (this.packetLength != that.packetLength) { | ||
| 168 | + return false; | ||
| 169 | + } | ||
| 170 | + return true; | ||
| 171 | + } | ||
| 172 | + | ||
| 151 | /** | 173 | /** |
| 152 | * Deserializer for EAPOL packets. | 174 | * Deserializer for EAPOL packets. |
| 153 | * | 175 | * | ... | ... |
| ... | @@ -42,6 +42,8 @@ public class RetryingFunction<U, V> implements Function<U, V> { | ... | @@ -42,6 +42,8 @@ public class RetryingFunction<U, V> implements Function<U, V> { |
| 42 | this.maxDelayBetweenRetries = maxDelayBetweenRetries; | 42 | this.maxDelayBetweenRetries = maxDelayBetweenRetries; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | + @SuppressWarnings("squid:S1181") | ||
| 46 | + // Yes we really do want to catch Throwable | ||
| 45 | @Override | 47 | @Override |
| 46 | public V apply(U input) { | 48 | public V apply(U input) { |
| 47 | int retryAttempts = 0; | 49 | int retryAttempts = 0; | ... | ... |
| ... | @@ -106,6 +106,8 @@ public class NettyMessaging implements MessagingService { | ... | @@ -106,6 +106,8 @@ public class NettyMessaging implements MessagingService { |
| 106 | protected char[] ksPwd; | 106 | protected char[] ksPwd; |
| 107 | protected char[] tsPwd; | 107 | protected char[] tsPwd; |
| 108 | 108 | ||
| 109 | + @SuppressWarnings("squid:S1181") | ||
| 110 | + // We really need to catch Throwable due to netty native epoll() handling | ||
| 109 | private void initEventLoopGroup() { | 111 | private void initEventLoopGroup() { |
| 110 | // try Epoll first and if that does work, use nio. | 112 | // try Epoll first and if that does work, use nio. |
| 111 | try { | 113 | try { | ... | ... |
-
Please register or login to post a comment