jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java
changeset 30649 e7cc8f48f616
parent 30374 2abaf49910ea
child 31426 9cd672654f97
--- a/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java	Mon May 18 17:34:48 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java	Mon May 18 17:38:38 2015 +0300
@@ -214,12 +214,19 @@
      * Return the printable string.
      */
     public String toString() {
-        return (super.toString() + "NameConstraints: [" +
-                ((permitted == null) ? "" :
-                     ("\n    Permitted:" + permitted.toString())) +
-                ((excluded == null) ? "" :
-                     ("\n    Excluded:" + excluded.toString()))
-                + "   ]\n");
+        StringBuilder sb = new StringBuilder();
+        sb.append(super.toString())
+            .append("NameConstraints: [");
+        if (permitted != null) {
+            sb.append("\n    Permitted:")
+                .append(permitted);
+        }
+        if (excluded != null) {
+            sb.append("\n    Excluded:")
+                .append(excluded);
+        }
+        sb.append("   ]\n");
+        return sb.toString();
     }
 
     /**