< prev index next >

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

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

*** 77,92 **** * * @param name the RFC822Name string * @throws IOException if name is not valid */ public void parseName(String name) throws IOException { ! if (name == null || name.length() == 0) { throw new IOException("RFC822Name may not be null or empty"); } // See if domain is a valid domain name String domain = name.substring(name.indexOf('@')+1); ! if (domain.length() == 0) { throw new IOException("RFC822Name may not end with @"); } else { //An RFC822 NameConstraint could start with a ., although //a DNSName may not if (domain.startsWith(".")) { --- 77,92 ---- * * @param name the RFC822Name string * @throws IOException if name is not valid */ public void parseName(String name) throws IOException { ! if (name == null || name.isEmpty()) { throw new IOException("RFC822Name may not be null or empty"); } // See if domain is a valid domain name String domain = name.substring(name.indexOf('@')+1); ! if (domain.isEmpty()) { throw new IOException("RFC822Name may not end with @"); } else { //An RFC822 NameConstraint could start with a ., although //a DNSName may not if (domain.startsWith(".")) {
< prev index next >