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
|
@ -1203,7 +1203,7 @@ public final class SSLSocketImpl
|
|||
synchronized void doneConnect() throws IOException {
|
||||
// In server mode, it is not necessary to set host and serverNames.
|
||||
// Otherwise, would require a reverse DNS lookup to get the hostname.
|
||||
if ((peerHost == null) || (peerHost.length() == 0)) {
|
||||
if (peerHost == null || peerHost.isEmpty()) {
|
||||
boolean useNameService =
|
||||
trustNameService && conContext.sslConfig.isClientMode;
|
||||
useImplicitHost(useNameService);
|
||||
|
@ -1238,8 +1238,7 @@ public final class SSLSocketImpl
|
|||
JavaNetInetAddressAccess jna =
|
||||
SharedSecrets.getJavaNetInetAddressAccess();
|
||||
String originalHostname = jna.getOriginalHostName(inetAddress);
|
||||
if ((originalHostname != null) &&
|
||||
(originalHostname.length() != 0)) {
|
||||
if (originalHostname != null && !originalHostname.isEmpty()) {
|
||||
|
||||
this.peerHost = originalHostname;
|
||||
if (conContext.sslConfig.serverNames.isEmpty() &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue