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.UnrecoverableKeyException;
|
||||||
import java.security.cert.CertificateException;
|
import java.security.cert.CertificateException;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -112,9 +113,7 @@ public class SSLContextBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (final TrustManager tm : tms) {
|
Collections.addAll(this.trustmanagers, tms);
|
||||||
this.trustmanagers.add(tm);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -151,9 +150,7 @@ public class SSLContextBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (final KeyManager km : kms) {
|
Collections.addAll(keymanagers, kms);
|
||||||
keymanagers.add(km);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,9 +410,7 @@ public class URIBuilder {
|
||||||
} else {
|
} else {
|
||||||
this.queryParams.clear();
|
this.queryParams.clear();
|
||||||
}
|
}
|
||||||
for (final NameValuePair nvp: nvps) {
|
Collections.addAll(this.queryParams, nvps);
|
||||||
this.queryParams.add(nvp);
|
|
||||||
}
|
|
||||||
this.encodedQuery = null;
|
this.encodedQuery = null;
|
||||||
this.encodedSchemeSpecificPart = null;
|
this.encodedSchemeSpecificPart = null;
|
||||||
this.query = null;
|
this.query = null;
|
||||||
|
|
|
@ -82,9 +82,7 @@ public class DefaultHttpRequestRetryHandler implements HttpRequestRetryHandler {
|
||||||
this.retryCount = retryCount;
|
this.retryCount = retryCount;
|
||||||
this.requestSentRetryEnabled = requestSentRetryEnabled;
|
this.requestSentRetryEnabled = requestSentRetryEnabled;
|
||||||
this.nonRetriableClasses = new HashSet<Class<? extends IOException>>();
|
this.nonRetriableClasses = new HashSet<Class<? extends IOException>>();
|
||||||
for (final Class<? extends IOException> clazz: clazzes) {
|
this.nonRetriableClasses.addAll(clazzes);
|
||||||
this.nonRetriableClasses.add(clazz);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue