src/java.base/share/classes/sun/security/x509/RFC822Name.java
changeset 53018 8bf9268df0e2
parent 52856 5f3b9b633731
child 53082 4c539cb11633
equal deleted inserted replaced
53017:e10a1f7aaa13 53018:8bf9268df0e2
    77      *
    77      *
    78      * @param name the RFC822Name string
    78      * @param name the RFC822Name string
    79      * @throws IOException if name is not valid
    79      * @throws IOException if name is not valid
    80      */
    80      */
    81     public void parseName(String name) throws IOException {
    81     public void parseName(String name) throws IOException {
    82         if (name == null || name.length() == 0) {
    82         if (name == null || name.isEmpty()) {
    83             throw new IOException("RFC822Name may not be null or empty");
    83             throw new IOException("RFC822Name may not be null or empty");
    84         }
    84         }
    85         // See if domain is a valid domain name
    85         // See if domain is a valid domain name
    86         String domain = name.substring(name.indexOf('@')+1);
    86         String domain = name.substring(name.indexOf('@')+1);
    87         if (domain.length() == 0) {
    87         if (domain.isEmpty()) {
    88             throw new IOException("RFC822Name may not end with @");
    88             throw new IOException("RFC822Name may not end with @");
    89         } else {
    89         } else {
    90             //An RFC822 NameConstraint could start with a ., although
    90             //An RFC822 NameConstraint could start with a ., although
    91             //a DNSName may not
    91             //a DNSName may not
    92             if (domain.startsWith(".")) {
    92             if (domain.startsWith(".")) {