Use Collections.addAll() and Collection.addAll() APIs instead of loops.
This commit is contained in:
parent
50ec2d075d
commit
3334f2d447
|
@ -38,6 +38,7 @@ import java.security.SecureRandom;
|
|||
import java.security.UnrecoverableKeyException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
|
@ -112,9 +113,7 @@ public class SSLContextBuilder {
|
|||
}
|
||||
}
|
||||
}
|
||||
for (final TrustManager tm : tms) {
|
||||
this.trustmanagers.add(tm);
|
||||
}
|
||||
Collections.addAll(this.trustmanagers, tms);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
@ -151,9 +150,7 @@ public class SSLContextBuilder {
|
|||
}
|
||||
}
|
||||
}
|
||||
for (final KeyManager km : kms) {
|
||||
keymanagers.add(km);
|
||||
}
|
||||
Collections.addAll(keymanagers, kms);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -410,9 +410,7 @@ public class URIBuilder {
|
|||
} else {
|
||||
this.queryParams.clear();
|
||||
}
|
||||
for (final NameValuePair nvp: nvps) {
|
||||
this.queryParams.add(nvp);
|
||||
}
|
||||
Collections.addAll(this.queryParams, nvps);
|
||||
this.encodedQuery = null;
|
||||
this.encodedSchemeSpecificPart = null;
|
||||
this.query = null;
|
||||
|
|
|
@ -82,9 +82,7 @@ public class DefaultHttpRequestRetryHandler implements HttpRequestRetryHandler {
|
|||
this.retryCount = retryCount;
|
||||
this.requestSentRetryEnabled = requestSentRetryEnabled;
|
||||
this.nonRetriableClasses = new HashSet<Class<? extends IOException>>();
|
||||
for (final Class<? extends IOException> clazz: clazzes) {
|
||||
this.nonRetriableClasses.add(clazz);
|
||||
}
|
||||
this.nonRetriableClasses.addAll(clazzes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue