mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb
This commit is contained in:
parent
c998ead188
commit
a3df1d618e
155 changed files with 340 additions and 382 deletions
|
@ -148,7 +148,7 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager
|
|||
"null or zero-length certificate chain");
|
||||
}
|
||||
|
||||
if (authType == null || authType.length() == 0) {
|
||||
if (authType == null || authType.isEmpty()) {
|
||||
throw new IllegalArgumentException(
|
||||
"null or zero-length authentication type");
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager
|
|||
// check endpoint identity
|
||||
String identityAlg = sslSocket.getSSLParameters().
|
||||
getEndpointIdentificationAlgorithm();
|
||||
if (identityAlg != null && identityAlg.length() != 0) {
|
||||
if (identityAlg != null && !identityAlg.isEmpty()) {
|
||||
checkIdentity(session, trustedChain[0], identityAlg, isClient,
|
||||
getRequestedServerNames(socket), chainsToPublicCA);
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager
|
|||
// check endpoint identity
|
||||
String identityAlg = engine.getSSLParameters().
|
||||
getEndpointIdentificationAlgorithm();
|
||||
if (identityAlg != null && identityAlg.length() != 0) {
|
||||
if (identityAlg != null && !identityAlg.isEmpty()) {
|
||||
checkIdentity(session, trustedChain[0], identityAlg, isClient,
|
||||
getRequestedServerNames(engine), chainsToPublicCA);
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager
|
|||
private static void checkIdentity(String hostname, X509Certificate cert,
|
||||
String algorithm, boolean chainsToPublicCA)
|
||||
throws CertificateException {
|
||||
if (algorithm != null && algorithm.length() != 0) {
|
||||
if (algorithm != null && !algorithm.isEmpty()) {
|
||||
// if IPv6 strip off the "[]"
|
||||
if ((hostname != null) && hostname.startsWith("[") &&
|
||||
hostname.endsWith("]")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue