src/java.naming/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java
changeset 53248 ed36ff53642c
parent 50768 68fa3d4026ea
equal deleted inserted replaced
53247:3fc330702246 53248:ed36ff53642c
   286      * @param hostname The server's hostname. If null, the hostname used to
   286      * @param hostname The server's hostname. If null, the hostname used to
   287      * open the connection will be used instead.
   287      * open the connection will be used instead.
   288      */
   288      */
   289     public void setConnection(Connection ldapConnection, String hostname) {
   289     public void setConnection(Connection ldapConnection, String hostname) {
   290         this.ldapConnection = ldapConnection;
   290         this.ldapConnection = ldapConnection;
   291         this.hostname = (hostname != null) ? hostname : ldapConnection.host;
   291         this.hostname = (hostname == null || hostname.isEmpty())
       
   292             ? ldapConnection.host : hostname;
   292         originalInputStream = ldapConnection.inStream;
   293         originalInputStream = ldapConnection.inStream;
   293         originalOutputStream = ldapConnection.outStream;
   294         originalOutputStream = ldapConnection.outStream;
   294     }
   295     }
   295 
   296 
   296     /*
   297     /*