< prev index next >

src/java.base/share/classes/sun/security/x509/DNSName.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

*** 70,80 **** * * @param name the DNSName. * @throws IOException if the name is not a valid DNSName subjectAltName */ public DNSName(String name) throws IOException { ! if (name == null || name.length() == 0) throw new IOException("DNSName must not be null or empty"); if (name.contains(" ")) throw new IOException("DNSName with blank components is not permitted"); if (name.startsWith(".") || name.endsWith(".")) throw new IOException("DNSName may not begin or end with a ."); --- 70,80 ---- * * @param name the DNSName. * @throws IOException if the name is not a valid DNSName subjectAltName */ public DNSName(String name) throws IOException { ! if (name == null || name.isEmpty()) throw new IOException("DNSName must not be null or empty"); if (name.contains(" ")) throw new IOException("DNSName with blank components is not permitted"); if (name.startsWith(".") || name.endsWith(".")) throw new IOException("DNSName may not begin or end with a .");
< prev index next >