INT-4150: Sonar Fixes

"New" issues for previous commit; Sonar reports as "new" issues in
changed files.
This commit is contained in:
Gary Russell
2018-12-06 12:18:26 -05:00
committed by Artem Bilan
parent 992c0ce6a7
commit 687e6d5004
3 changed files with 14 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -556,7 +556,7 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
}
@Override
public void destroy() throws Exception {
public void destroy() {
synchronized (this.folderMonitor) {
MailTransportUtils.closeFolder(this.folder, this.shouldDeleteMessages);
MailTransportUtils.closeService(this.store);

View File

@@ -149,7 +149,7 @@ public class ImapMailReceiver extends AbstractMailReceiver {
}
@Override
public void destroy() throws Exception {
public void destroy() {
super.destroy();
if (this.isInternalScheduler) {
((ThreadPoolTaskScheduler) this.scheduler).shutdown();

View File

@@ -237,6 +237,11 @@ public class TestMailServer {
class ImapHandler extends MailHandler {
/**
* Time to wait while IDLE before returning a result.
*/
private static final int IDLE_WAIT_TIME = 1000;
ImapHandler(Socket socket) {
super(socket);
}
@@ -348,7 +353,7 @@ public class TestMailServer {
idleTag = tag;
if (!idled) {
try {
Thread.sleep(1000);
Thread.sleep(IDLE_WAIT_TIME);
write("* 2 EXISTS");
seen = false;
}
@@ -392,9 +397,9 @@ public class TestMailServer {
private final ExecutorService exec = Executors.newCachedThreadPool();
protected final Set<String> assertions = new HashSet<>();
protected final Set<String> assertions = new HashSet<>(); // NOSONAR protected
protected final List<String> messages = new ArrayList<>();
protected final List<String> messages = new ArrayList<>(); // NOSONAR protected
private volatile boolean listening;
@@ -461,13 +466,13 @@ public class TestMailServer {
+ "Subject: Test Email\r\n"
+ "\r\n" + BODY;
protected final Socket socket;
protected final Socket socket; // NOSONAR protected
private BufferedWriter writer;
StringBuilder sb = new StringBuilder();
protected StringBuilder sb = new StringBuilder(); // NOSONAR protected
protected BufferedReader reader;
protected BufferedReader reader; // NOSONAR protected
MailHandler(Socket socket) {
this.socket = socket;