IDE warnings cleanup (#8768)

Motivation:

IDE shows some warnings

Modification:

Small IDE warnings cleanup in different places.

Result:

Less warnings
This commit is contained in:
Dmitriy Dumanskiy 2019-01-23 15:01:48 +02:00 committed by Norman Maurer
parent 9e9ee2ecd0
commit 4a10357fd8
7 changed files with 13 additions and 35 deletions

View File

@ -461,13 +461,10 @@ abstract class PoolArena<T> implements PoolArenaMetric {
continue;
}
PoolSubpage<?> s = head.next;
for (;;) {
do {
metrics.add(s);
s = s.next;
if (s == head) {
break;
}
}
} while (s != head);
}
return metrics;
}
@ -631,13 +628,10 @@ abstract class PoolArena<T> implements PoolArenaMetric {
.append(i)
.append(": ");
PoolSubpage<?> s = head.next;
for (;;) {
do {
buf.append(s);
s = s.next;
if (s == head) {
break;
}
}
} while (s != head);
}
}

View File

@ -194,7 +194,7 @@ public class Http2Exception extends Exception {
/**
* Provides a hint as to if shutdown is justified, what type of shutdown should be executed.
*/
public static enum ShutdownHint {
public enum ShutdownHint {
/**
* Do not shutdown the underlying channel.
*/
@ -207,7 +207,7 @@ public class Http2Exception extends Exception {
/**
* Close the channel immediately after a {@code GOAWAY} is sent.
*/
HARD_SHUTDOWN;
HARD_SHUTDOWN
}
/**

View File

@ -20,6 +20,7 @@ import io.netty.util.internal.ObjectUtil;
import io.netty.util.internal.UnstableApi;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
@ -94,9 +95,7 @@ public final class SmtpRequests {
} else {
List<CharSequence> params = new ArrayList<>(mailParameters.length + 1);
params.add(sender != null? "FROM:<" + sender + '>' : FROM_NULL_SENDER);
for (CharSequence param : mailParameters) {
params.add(param);
}
Collections.addAll(params, mailParameters);
return new DefaultSmtpRequest(SmtpCommand.MAIL, params);
}
}
@ -111,9 +110,7 @@ public final class SmtpRequests {
} else {
List<CharSequence> params = new ArrayList<>(rcptParameters.length + 1);
params.add("TO:<" + recipient + '>');
for (CharSequence param : rcptParameters) {
params.add(param);
}
Collections.addAll(params, rcptParameters);
return new DefaultSmtpRequest(SmtpCommand.RCPT, params);
}
}

View File

@ -101,9 +101,7 @@ public class JdkSslContext extends SslContext {
// Choose the sensible default list of protocols.
final String[] supportedProtocols = engine.getSupportedProtocols();
Set<String> supportedProtocolsSet = new HashSet<>(supportedProtocols.length);
for (int i = 0; i < supportedProtocols.length; ++i) {
supportedProtocolsSet.add(supportedProtocols[i]);
}
Collections.addAll(supportedProtocolsSet, supportedProtocols);
List<String> protocols = new ArrayList<>();
addIfSupported(
supportedProtocolsSet, protocols,

View File

@ -81,10 +81,7 @@ final class PemReader {
List<ByteBuf> certs = new ArrayList<>();
Matcher m = CERT_PATTERN.matcher(content);
int start = 0;
for (;;) {
if (!m.find(start)) {
break;
}
while (m.find(start)) {
ByteBuf base64 = Unpooled.copiedBuffer(m.group(1), CharsetUtil.US_ASCII);
ByteBuf der = Base64.decode(base64);

View File

@ -122,9 +122,7 @@ final class SslUtils {
// AES256 requires JCE unlimited strength jurisdiction policy files.
defaultCiphers.add("TLS_RSA_WITH_AES_256_CBC_SHA");
for (String tlsv13Cipher: DEFAULT_TLSV13_CIPHER_SUITES) {
defaultCiphers.add(tlsv13Cipher);
}
Collections.addAll(defaultCiphers, DEFAULT_TLSV13_CIPHER_SUITES);
DEFAULT_CIPHER_SUITES = defaultCiphers.toArray(new String[0]);
}

View File

@ -61,12 +61,6 @@ public class SocketMultipleConnectTest extends AbstractSocketTest {
@Override
protected List<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>> newFactories() {
List<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>> factories
= new ArrayList<>();
for (TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap> comboFactory
: SocketTestPermutation.INSTANCE.socket()) {
factories.add(comboFactory);
}
return factories;
return new ArrayList<>(SocketTestPermutation.INSTANCE.socket());
}
}