src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java

Print this page
rev 10521 : 8055723[core]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>

@@ -86,11 +86,11 @@
             //for name component
             for (int j = 0; (k = DN.indexOf(',', j)) >= 0; j = k + 1) {
                 l += countQuotes(DN, j, k);
 
                 if ((k > 0) && (DN.charAt(k - 1) != '\\') && (l % 2) == 0) {
-                    sb.append(parseRDN(DN.substring(i, k).trim(), toXml) + ",");
+                    sb.append(parseRDN(DN.substring(i, k).trim(), toXml)).append(',');
 
                     i = k + 1;
                     l = 0;
                 }
             }

@@ -119,11 +119,11 @@
 
         for (int j = 0; (k = str.indexOf('+', j)) >= 0; j = k + 1) {
             l += countQuotes(str, j, k);
 
             if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) {
-                sb.append(parseATAV(trim(str.substring(i, k)), toXml) + "+");
+                sb.append(parseATAV(trim(str.substring(i, k)), toXml)).append('+');
 
                 i = k + 1;
                 l = 0;
             }
         }

@@ -367,11 +367,11 @@
         StringBuilder sb = new StringBuilder();
         int i = 0;
         int k;
 
         for (int j = 0; (k = string.indexOf("\\20", j)) >= 0; j = k + 3) {
-            sb.append(trim(string.substring(i, k)) + "\\ ");
+            sb.append(trim(string.substring(i, k))).append("\\ ");
 
             i = k + 3;
         }
 
         sb.append(string.substring(i));

@@ -416,11 +416,11 @@
 
         for (int j = 0; (k = str.indexOf(symbol, j)) >= 0; j = k + 1) {
             l += countQuotes(str, j, k);
 
             if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) {
-                sb.append(trim(str.substring(i, k)) + replace);
+                sb.append(trim(str.substring(i, k))).append(replace);
 
                 i = k + 1;
                 l = 0;
             }
         }