camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject svn commit: r1383517 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/util/ components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/ components/camel-jsch/src/main/java/org...
Date Tue, 11 Sep 2012 18:34:27 GMT
Author: bvahdat
Date: Tue Sep 11 18:34:26 2012
New Revision: 1383517

URL: http://svn.apache.org/viewvc?rev=1383517&view=rev
Log:
CAMEL-5589: Prefer to make use of StringBuilder instead of StringBuffer where applicable.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/AntPathMatcher.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/CollectionStringBuffer.java
    camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackException.java
    camel/trunk/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpFile.java
    camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java
    camel/trunk/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesStrategyTest.java
    camel/trunk/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamHeaderTest.java
    camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java
    camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
    camel/trunk/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/ZooKeeperTestSupport.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/zookeeper/ZookeeperOSGiTestSupport.java
    camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
    camel/trunk/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
    camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
Tue Sep 11 18:34:26 2012
@@ -136,7 +136,7 @@ public final class MappedEndpointConfigu
             q += entry;
         }
 
-        StringBuffer u = new StringBuffer(64);
+        StringBuilder u = new StringBuilder(64);
         if (scheme != null) {
             u.append(scheme); // SHOULD NOT be null
             u.append(":");

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/AntPathMatcher.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/AntPathMatcher.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/AntPathMatcher.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/AntPathMatcher.java Tue Sep
11 18:34:26 2012
@@ -395,7 +395,7 @@ public class AntPathMatcher {
         String[] patternParts = tokenizeToStringArray(pattern, this.pathSeparator);
         String[] pathParts = tokenizeToStringArray(path, this.pathSeparator);
 
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
 
         // Add any path parts that have a wildcarded pattern part.
         int puts = 0;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/CollectionStringBuffer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/CollectionStringBuffer.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/CollectionStringBuffer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/CollectionStringBuffer.java
Tue Sep 11 18:34:26 2012
@@ -22,7 +22,7 @@ package org.apache.camel.util;
  * @version 
  */
 public class CollectionStringBuffer {
-    private final StringBuffer buffer = new StringBuffer();
+    private final StringBuilder buffer = new StringBuilder();
     private String separator;
     private boolean first = true;
 

Modified: camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackException.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackException.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackException.java
(original)
+++ camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackException.java
Tue Sep 11 18:34:26 2012
@@ -41,7 +41,7 @@ public class FlatpackException extends C
 
     @Override
     public String getMessage() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(super.getMessage());
         if (errors != null && !errors.isEmpty()) {
             sb.append("\n");

Modified: camel/trunk/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpFile.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpFile.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpFile.java
(original)
+++ camel/trunk/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpFile.java
Tue Sep 11 18:34:26 2012
@@ -28,7 +28,7 @@ public class ScpFile {
     private String parent;
 
     public String header() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         buffer.append(directory ? "D" : "C");
         buffer.append(" ");
         return buffer.toString();

Modified: camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java
(original)
+++ camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java
Tue Sep 11 18:34:26 2012
@@ -189,7 +189,7 @@ public class RestletEndpoint extends Def
     // Update the endpointUri with the restlet method information
     protected void updateEndpointUri() {
         String endpointUri = getEndpointUri();
-        StringBuffer methods = new StringBuffer();
+        StringBuilder methods = new StringBuilder();
         if (getRestletMethods() != null && getRestletMethods().length > 0) {
             for (Method method : getRestletMethods()) {
                 methods = methods.append(method.getName()).append(',');

Modified: camel/trunk/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesStrategyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesStrategyTest.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesStrategyTest.java
(original)
+++ camel/trunk/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesStrategyTest.java
Tue Sep 11 18:34:26 2012
@@ -35,7 +35,7 @@ public class StreamGroupLinesStrategyTes
 
         @Override
         public Object groupLines(List<String> lines) {
-            StringBuffer buffer = new StringBuffer();
+            StringBuilder buffer = new StringBuilder();
             for (String line : lines) {
                 buffer.append(line);
                 buffer.append("\n");

Modified: camel/trunk/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamHeaderTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamHeaderTest.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamHeaderTest.java
(original)
+++ camel/trunk/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamHeaderTest.java
Tue Sep 11 18:34:26 2012
@@ -30,7 +30,7 @@ public class StreamHeaderTest extends Ca
 
     // START SNIPPET: e1
     private OutputStream mystream = new MyOutputStream();
-    private StringBuffer sb = new StringBuffer();
+    private StringBuilder sb = new StringBuilder();
 
     @Test
     public void testStringContent() {

Modified: camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java
(original)
+++ camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java
Tue Sep 11 18:34:26 2012
@@ -223,7 +223,7 @@ public final class CamelBlueprintHelper 
      */
     private static String explode(Dictionary<?, ?> dictionary) {
         Enumeration<?> keys = dictionary.keys();
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         while (keys.hasMoreElements()) {
             Object key = keys.nextElement();
             result.append(String.format("%s=%s", key, dictionary.get(key)));

Modified: camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
(original)
+++ camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
Tue Sep 11 18:34:26 2012
@@ -221,7 +221,7 @@ public class XmppEndpoint extends Defaul
     public static String getXmppExceptionLogMessage(XMPPException e) {
         XMPPError xmppError = e.getXMPPError();
         Throwable t = e.getWrappedThrowable();
-        StringBuffer strBuff = new StringBuffer();
+        StringBuilder strBuff = new StringBuilder();
         if (xmppError != null) {
             strBuff.append("[ ").append(xmppError.getCode()).append(" ] ")
                 .append(xmppError.getCondition()).append(" : ")

Modified: camel/trunk/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/ZooKeeperTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/ZooKeeperTestSupport.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/ZooKeeperTestSupport.java
(original)
+++ camel/trunk/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/ZooKeeperTestSupport.java
Tue Sep 11 18:34:26 2012
@@ -268,7 +268,7 @@ public class ZooKeeperTestSupport extend
             outstream.flush();
 
             reader = IOHelper.buffered(new InputStreamReader(sock.getInputStream()));
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             String line;
             while ((line = reader.readLine()) != null) {
                 sb.append(line + "\n");

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java
Tue Sep 11 18:34:26 2012
@@ -116,7 +116,7 @@ public abstract class AbstractIntegratio
      */
     private static String explode(Dictionary<?, ?> dictionary) {
         Enumeration<?> keys = dictionary.keys();
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         while (keys.hasMoreElements()) {
             Object key = keys.nextElement();
             result.append(String.format("%s=%s", key, dictionary.get(key)));

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/zookeeper/ZookeeperOSGiTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/zookeeper/ZookeeperOSGiTestSupport.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/zookeeper/ZookeeperOSGiTestSupport.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/zookeeper/ZookeeperOSGiTestSupport.java
Tue Sep 11 18:34:26 2012
@@ -262,7 +262,7 @@ public class ZookeeperOSGiTestSupport ex
             outstream.flush();
 
             reader = IOHelper.buffered(new InputStreamReader(sock.getInputStream()));
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             String line;
             while ((line = reader.readLine()) != null) {
                 sb.append(line + "\n");

Modified: camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
(original)
+++ camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
Tue Sep 11 18:34:26 2012
@@ -428,7 +428,7 @@ public class RunMojo extends AbstractExe
         }
         
         if (getLog().isDebugEnabled()) {
-            StringBuffer msg = new StringBuffer("Invoking: ");
+            StringBuilder msg = new StringBuilder("Invoking: ");
             msg.append(mainClass);
             msg.append(".main(");
             for (int i = 0; i < arguments.length; i++) {

Modified: camel/trunk/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
(original)
+++ camel/trunk/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
Tue Sep 11 18:34:26 2012
@@ -349,7 +349,7 @@ public class RunMojo extends AbstractExe
         args.toArray(arguments);
 
         if (getLog().isDebugEnabled()) {
-            StringBuffer msg = new StringBuffer("Invoking : ");
+            StringBuilder msg = new StringBuilder("Invoking : ");
             msg.append(mainClass);
             msg.append(".main(");
             for (int i = 0; i < arguments.length; i++) {

Modified: camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java?rev=1383517&r1=1383516&r2=1383517&view=diff
==============================================================================
--- camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
(original)
+++ camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
Tue Sep 11 18:34:26 2012
@@ -227,7 +227,7 @@ public class HtmlToPdfMojo extends Abstr
 
         getLog().info("About to execute PrinceXml (see www.princexml.com)");
         String[] lines = cl.getCommandline();
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         for (String line : lines) {
             buffer.append(" ");
             buffer.append(line);



Mime
View raw message