commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1557379 - in /commons/proper/exec/trunk/src: main/java/org/apache/commons/exec/ main/java/org/apache/commons/exec/launcher/ main/java/org/apache/commons/exec/util/ test/java/org/apache/commons/exec/
Date Sat, 11 Jan 2014 13:10:49 GMT
Author: sebb
Date: Sat Jan 11 13:10:49 2014
New Revision: 1557379

URL: http://svn.apache.org/r1557379
Log:
StringBuffer => StringBuilder where possible

Modified:
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
    commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java?rev=1557379&r1=1557378&r2=1557379&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java Sat Jan
11 13:10:49 2014
@@ -347,7 +347,7 @@ public class CommandLine {
         int state = normal;
         final StringTokenizer tok = new StringTokenizer(toProcess, "\"\' ", true);
         final ArrayList<String> list = new ArrayList<String>();
-        StringBuffer current = new StringBuffer();
+        StringBuilder current = new StringBuilder();
         boolean lastTokenHasBeenQuoted = false;
 
         while (tok.hasMoreTokens()) {
@@ -377,7 +377,7 @@ public class CommandLine {
                 } else if (" ".equals(nextTok)) {
                     if (lastTokenHasBeenQuoted || current.length() != 0) {
                         list.add(current.toString());
-                        current = new StringBuffer();
+                        current = new StringBuilder();
                     }
                 } else {
                     current.append(nextTok);

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java?rev=1557379&r1=1557378&r2=1557379&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
(original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
Sat Jan 11 13:10:49 2014
@@ -100,7 +100,7 @@ public class VmsCommandLauncher extends 
                     String value = entry.getValue();
                     // Any embedded " values need to be doubled
                     if (value.indexOf('\"') > 0) {
-                        final StringBuffer sb = new StringBuffer();
+                        final StringBuilder sb = new StringBuilder();
                         for (int i = 0; i < value.length(); i++) {
                             final char c = value.charAt(i);
                             if (c == '\"') {

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java?rev=1557379&r1=1557378&r2=1557379&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
(original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
Sat Jan 11 13:10:49 2014
@@ -84,7 +84,7 @@ public class StringUtils {
             switch (ch) {
 
                 case '$':
-                    final StringBuffer nameBuf = new StringBuffer();
+                    final StringBuilder nameBuf = new StringBuilder();
                     del = argStr.charAt(cIdx + 1);
                     if (del == '{') {
                         cIdx++;
@@ -192,7 +192,7 @@ public class StringUtils {
      * @return the concatenated strings
      */
     public static String toString(final String[] strings, final String separator) {
-        final StringBuffer sb = new StringBuffer();
+        final StringBuilder sb = new StringBuilder();
         for (int i = 0; i < strings.length; i++) {
             if (i > 0) {
                 sb.append(separator);
@@ -227,7 +227,7 @@ public class StringUtils {
             cleanedArgument = cleanedArgument.substring(0, cleanedArgument.length() - 1);
         }
 
-        final StringBuffer buf = new StringBuffer();
+        final StringBuilder buf = new StringBuilder();
         if (cleanedArgument.indexOf(DOUBLE_QUOTE) > -1) {
             if (cleanedArgument.indexOf(SINGLE_QUOTE) > -1) {
                 throw new IllegalArgumentException(

Modified: commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java?rev=1557379&r1=1557378&r2=1557379&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
(original)
+++ commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
Sat Jan 11 13:10:49 2014
@@ -733,7 +733,7 @@ public class DefaultExecutorTest {
     private String readFile(final File file) throws Exception {
 
         String text;
-        final StringBuffer contents = new StringBuffer();
+        final StringBuilder contents = new StringBuilder();
         final BufferedReader reader = new BufferedReader(new FileReader(file));
 
         while ((text = reader.readLine()) != null)



Mime
View raw message