src/java.base/share/classes/sun/security/x509/DNSName.java
changeset 53018 8bf9268df0e2
parent 52856 5f3b9b633731
child 53082 4c539cb11633
equal deleted inserted replaced
53017:e10a1f7aaa13 53018:8bf9268df0e2
    70      *
    70      *
    71      * @param name the DNSName.
    71      * @param name the DNSName.
    72      * @throws IOException if the name is not a valid DNSName subjectAltName
    72      * @throws IOException if the name is not a valid DNSName subjectAltName
    73      */
    73      */
    74     public DNSName(String name) throws IOException {
    74     public DNSName(String name) throws IOException {
    75         if (name == null || name.length() == 0)
    75         if (name == null || name.isEmpty())
    76             throw new IOException("DNSName must not be null or empty");
    76             throw new IOException("DNSName must not be null or empty");
    77         if (name.contains(" "))
    77         if (name.contains(" "))
    78             throw new IOException("DNSName with blank components is not permitted");
    78             throw new IOException("DNSName with blank components is not permitted");
    79         if (name.startsWith(".") || name.endsWith("."))
    79         if (name.startsWith(".") || name.endsWith("."))
    80             throw new IOException("DNSName may not begin or end with a .");
    80             throw new IOException("DNSName may not begin or end with a .");