Fix some new Sonar smells

This commit is contained in:
Artem Bilan
2020-10-07 12:31:44 -04:00
parent d8dd19106c
commit 94e6521510
2 changed files with 8 additions and 4 deletions

View File

@@ -175,7 +175,7 @@ public class TcpNetServerConnectionFactory extends AbstractServerConnectionFacto
}
}
}
catch (IOException ex) {
catch (IOException ex) { // NOSONAR flow control via exceptions
// don't log an error if we had a good socket once and now it's closed
if (ex instanceof SocketException && theServerSocket != null) { // NOSONAR flow control via exceptions
logger.info("Server Socket closed");

View File

@@ -177,12 +177,15 @@ public final class TestMailServer {
super(socket);
}
@Override
@Override // NOSONAR
void doRun() {
try {
write("+OK POP3");
while (!socket.isClosed()) {
String line = reader.readLine();
if (line == null) {
break;
}
switch (line) {
case "CAPA":
write(PLUS_OK);
@@ -206,6 +209,8 @@ public final class TestMailServer {
write(PLUS_OK);
socket.close();
break;
default:
throw new UnsupportedOperationException(line);
}
}
}
@@ -255,8 +260,7 @@ public final class TestMailServer {
super(socket);
}
@Override
// NOSONAR
@Override // NOSONAR
void doRun() {
try {
write("* OK IMAP4rev1 Service Ready");