ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject [07/12] git commit: stringbuilder instead of stringbuffer
Date Thu, 28 Aug 2014 07:04:48 GMT
stringbuilder instead of stringbuffer


Project: http://git-wip-us.apache.org/repos/asf/ant-easyant-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-easyant-core/commit/97c58860
Tree: http://git-wip-us.apache.org/repos/asf/ant-easyant-core/tree/97c58860
Diff: http://git-wip-us.apache.org/repos/asf/ant-easyant-core/diff/97c58860

Branch: refs/heads/master
Commit: 97c588604f6c50efb2ee194f12087076a5fba0de
Parents: f5e6083
Author: Jean-Louis Boudart <jeanlouis.boudart@gmail.com>
Authored: Thu Aug 28 08:52:39 2014 +0200
Committer: Jean-Louis Boudart <jeanlouis.boudart@gmail.com>
Committed: Thu Aug 28 08:52:39 2014 +0200

----------------------------------------------------------------------
 .../java/org/apache/easyant/core/EasyAntEngine.java   |  2 +-
 .../java/org/apache/easyant/core/EasyAntMain.java     |  4 ++--
 .../core/ant/listerners/BuildExecutionTimer.java      |  2 +-
 .../core/configuration/EasyAntConfigParser.java       |  2 +-
 .../easyant/core/report/XMLEasyAntReportWriter.java   | 14 +++++++-------
 .../easyant/tasks/IvyDependencyUpdateChecker.java     |  2 +-
 .../java/org/apache/easyant/core/EasyAntBaseTest.java |  2 +-
 7 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-easyant-core/blob/97c58860/src/main/java/org/apache/easyant/core/EasyAntEngine.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/easyant/core/EasyAntEngine.java b/src/main/java/org/apache/easyant/core/EasyAntEngine.java
index 04a8cdc..b1f0093 100755
--- a/src/main/java/org/apache/easyant/core/EasyAntEngine.java
+++ b/src/main/java/org/apache/easyant/core/EasyAntEngine.java
@@ -722,7 +722,7 @@ public class EasyAntEngine {
                 }
                 props.load(in);
 
-                StringBuffer msg = new StringBuffer();
+                StringBuilder msg = new StringBuilder();
                 msg.append("EasyAnt version ");
                 msg.append(props.getProperty("VERSION"));
                 msg.append(" compiled on ");

http://git-wip-us.apache.org/repos/asf/ant-easyant-core/blob/97c58860/src/main/java/org/apache/easyant/core/EasyAntMain.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/easyant/core/EasyAntMain.java b/src/main/java/org/apache/easyant/core/EasyAntMain.java
index 403577f..a35b887 100755
--- a/src/main/java/org/apache/easyant/core/EasyAntMain.java
+++ b/src/main/java/org/apache/easyant/core/EasyAntMain.java
@@ -513,7 +513,7 @@ public class EasyAntMain implements AntMain {
             // now, start printing the targets and their descriptions
             String lSep = System.getProperty("line.separator");
             String spaces = String.format("%" + maxlen + "s", ' ');
-            StringBuffer msg = new StringBuffer();
+            StringBuilder msg = new StringBuilder();
             msg.append(lSep).append(heading).append(lSep).append(lSep);
             for (int i = 0; i < names.size(); i++) {
                 msg.append(" ");
@@ -738,7 +738,7 @@ public class EasyAntMain implements AntMain {
                 }
                 props.load(in);
 
-                StringBuffer msg = new StringBuffer();
+                StringBuilder msg = new StringBuilder();
                 msg.append("Apache Ant version ");
                 msg.append(props.getProperty("VERSION"));
                 msg.append(" compiled on ");

http://git-wip-us.apache.org/repos/asf/ant-easyant-core/blob/97c58860/src/main/java/org/apache/easyant/core/ant/listerners/BuildExecutionTimer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/easyant/core/ant/listerners/BuildExecutionTimer.java
b/src/main/java/org/apache/easyant/core/ant/listerners/BuildExecutionTimer.java
index 6fadee0..8a788d0 100644
--- a/src/main/java/org/apache/easyant/core/ant/listerners/BuildExecutionTimer.java
+++ b/src/main/java/org/apache/easyant/core/ant/listerners/BuildExecutionTimer.java
@@ -180,7 +180,7 @@ public class BuildExecutionTimer implements BuildListener, SubBuildListener
{
             maxExecTimeLength = result.getFormattedElapsedTime().length() > maxExecTimeLength
? result
                     .getFormattedElapsedTime().length() : maxExecTimeLength;
         }
-        StringBuffer sb = new StringBuffer(org.apache.tools.ant.util.StringUtils.LINE_SEP);
+        StringBuilder sb = new StringBuilder(org.apache.tools.ant.util.StringUtils.LINE_SEP);
         for (ExecutionResult result : results) {
             String moduleName = result.getUnitName();
             int variableSpaces = maxUnitNameLength - moduleName.length() + constantSpaces;

http://git-wip-us.apache.org/repos/asf/ant-easyant-core/blob/97c58860/src/main/java/org/apache/easyant/core/configuration/EasyAntConfigParser.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/easyant/core/configuration/EasyAntConfigParser.java
b/src/main/java/org/apache/easyant/core/configuration/EasyAntConfigParser.java
index da6fea3..c7d329c 100644
--- a/src/main/java/org/apache/easyant/core/configuration/EasyAntConfigParser.java
+++ b/src/main/java/org/apache/easyant/core/configuration/EasyAntConfigParser.java
@@ -122,7 +122,7 @@ public class EasyAntConfigParser {
         }
 
         private String getLocationString(SAXParseException ex) {
-            StringBuffer str = new StringBuffer();
+            StringBuilder str = new StringBuilder();
 
             String systemId = ex.getSystemId();
             if (systemId != null) {

http://git-wip-us.apache.org/repos/asf/ant-easyant-core/blob/97c58860/src/main/java/org/apache/easyant/core/report/XMLEasyAntReportWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/easyant/core/report/XMLEasyAntReportWriter.java b/src/main/java/org/apache/easyant/core/report/XMLEasyAntReportWriter.java
index 8d6e39a..f7c06dc 100644
--- a/src/main/java/org/apache/easyant/core/report/XMLEasyAntReportWriter.java
+++ b/src/main/java/org/apache/easyant/core/report/XMLEasyAntReportWriter.java
@@ -95,7 +95,7 @@ public class XMLEasyAntReportWriter {
         out.println("\t<configurations>");
 
         for (Configuration configuration : easyAntReport.getModuleDescriptor().getConfigurations())
{
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             sb.append("\t\t<configuration name=\"");
             sb.append(XMLHelper.escape(configuration.getName()));
             sb.append("\" description=\"");
@@ -139,7 +139,7 @@ public class XMLEasyAntReportWriter {
         if (dep.getModuleRevision() != null) {
             md = dep.getModuleRevision().getDescriptor();
         }
-        StringBuffer details = new StringBuffer();
+        StringBuilder details = new StringBuilder();
         if (dep.isLoaded()) {
             details.append(" status=\"");
             details.append(XMLHelper.escape(dep.getDescriptor().getStatus()));
@@ -310,7 +310,7 @@ public class XMLEasyAntReportWriter {
     }
 
     private String toString(String[] strs) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         for (int i = 0; i < strs.length; i++) {
             buf.append(strs[i]);
             if (i + 1 < strs.length) {
@@ -349,7 +349,7 @@ public class XMLEasyAntReportWriter {
         for (Entry<String, PropertyDescriptor> entry : properties.entrySet()) {
             PropertyDescriptor propertyDescriptor = entry.getValue();
 
-            StringBuffer param = new StringBuffer();
+            StringBuilder param = new StringBuilder();
             param.append("\t\t\t<property name=\"");
             param.append(propertyDescriptor.getName());
             param.append("\"");
@@ -427,7 +427,7 @@ public class XMLEasyAntReportWriter {
 
         for (ImportedModuleReport importedModuleReport : importedModuleReports) {
             String mode = importedModuleReport.getMode() != null ? importedModuleReport.getMode()
: "import";
-            StringBuffer importedModule = new StringBuffer();
+            StringBuilder importedModule = new StringBuilder();
             try {
                 ModuleRevisionId mrid = ModuleRevisionId.parse(importedModuleReport.getModuleMrid());
                 importedModule.append("\t\t\t<import organisation=\"").append(mrid.getOrganisation())
@@ -470,7 +470,7 @@ public class XMLEasyAntReportWriter {
             extensionPointReports = easyAntReport.getExtensionPointReportsFromCurrentModule();
         }
         for (ExtensionPointReport extensionPointReport : extensionPointReports) {
-            StringBuffer extensionPoint = new StringBuffer();
+            StringBuilder extensionPoint = new StringBuilder();
             extensionPoint.append("\t\t\t<extension-point name=\"").append(extensionPointReport.getName()).append("\"");
             if (extensionPointReport.getDescription() != null) {
                 extensionPoint.append(" description=\"");
@@ -498,7 +498,7 @@ public class XMLEasyAntReportWriter {
         }
 
         for (TargetReport targetReport : targetReports) {
-            StringBuffer target = new StringBuffer();
+            StringBuilder target = new StringBuilder();
             target.append("\t\t\t<target name=\"").append(targetReport.getName()).append("\"");
             if (targetReport.getDescription() != null) {
                 target.append(" description=\"");

http://git-wip-us.apache.org/repos/asf/ant-easyant-core/blob/97c58860/src/main/java/org/apache/easyant/tasks/IvyDependencyUpdateChecker.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/easyant/tasks/IvyDependencyUpdateChecker.java b/src/main/java/org/apache/easyant/tasks/IvyDependencyUpdateChecker.java
index 6c17e93..ec3ed25 100644
--- a/src/main/java/org/apache/easyant/tasks/IvyDependencyUpdateChecker.java
+++ b/src/main/java/org/apache/easyant/tasks/IvyDependencyUpdateChecker.java
@@ -108,7 +108,7 @@ public class IvyDependencyUpdateChecker extends IvyPostResolveTask {
                         // .isTranstive() methods doesn't have the same meaning)
                         boolean isTransitiveDependency = latest.getDependencyDescriptor(latest.getRoot())
== null;
                         if ((!isTransitiveDependency) || (isTransitiveDependency &&
showTransitive)) {
-                            StringBuffer sb = new StringBuffer();
+                            StringBuilder sb = new StringBuilder();
                             sb.append("\t")//
                                     .append(originalDependency.getResolvedId().getOrganisation())
//
                                     .append('#')//

http://git-wip-us.apache.org/repos/asf/ant-easyant-core/blob/97c58860/src/test/java/org/apache/easyant/core/EasyAntBaseTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/easyant/core/EasyAntBaseTest.java b/src/test/java/org/apache/easyant/core/EasyAntBaseTest.java
index d4587be..6fa7936 100755
--- a/src/test/java/org/apache/easyant/core/EasyAntBaseTest.java
+++ b/src/test/java/org/apache/easyant/core/EasyAntBaseTest.java
@@ -277,7 +277,7 @@ public abstract class EasyAntBaseTest {
     }
 
     private String cleanBuffer(StringBuffer buffer) {
-        StringBuffer cleanedBuffer = new StringBuffer();
+        StringBuilder cleanedBuffer = new StringBuilder();
         for (int i = 0; i < buffer.length(); i++) {
             char ch = buffer.charAt(i);
             if (ch != '\r') {


Mime
View raw message