Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2016-04-21 17:11:13 -0400
committerGerrit Code Review @ Eclipse.org2016-04-21 18:49:32 -0400
commitccbab86d6cd5f9c6c6a2e53cd6505a95b45d6f30 (patch)
tree02575073de886a594454e26b7480127bf3f85303 /build/org.eclipse.cdt.autotools.core/src
parent8a2fd3307b261c0452f3ea08235a7d898a11a7b8 (diff)
downloadorg.eclipse.cdt-ccbab86d6cd5f9c6c6a2e53cd6505a95b45d6f30.tar.gz
org.eclipse.cdt-ccbab86d6cd5f9c6c6a2e53cd6505a95b45d6f30.tar.xz
org.eclipse.cdt-ccbab86d6cd5f9c6c6a2e53cd6505a95b45d6f30.zip
Bug 492200 - Replace StringBuffer with StringBuilder
There are many opportunities for replacing `StringBuffer` with `StringBuilder` provided that the type isn't visible from the public API and is used only in internal methods. Replace these where appropriate. Change-Id: I769ceb6eaee18d183fb0e00fa0d730651f8a7edb Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'build/org.eclipse.cdt.autotools.core/src')
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java4
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java8
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java2
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java6
4 files changed, 10 insertions, 10 deletions
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java
index 93216a963e..51b79a8061 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Red Hat Inc. and others.
+ * Copyright (c) 2012, 2016 Red Hat Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -91,7 +91,7 @@ public class AutotoolsConfigurationBuilder extends ACBuilder {
OutputStream cos = console.getOutputStream();
String errormsg = AutotoolsPlugin.getResourceString(BUILD_STOPPED);
- StringBuffer buf = new StringBuffer(errormsg);
+ StringBuilder buf = new StringBuilder(errormsg);
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
buf.append("(").append(result.getMessage()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
index 09f3adf7e3..2076cfd12d 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
@@ -872,7 +872,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
"MakeGenerator.make.message", msgs)); //$NON-NLS-1$
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
// Launch command - main invocation
if (consoleStart)
@@ -968,7 +968,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
}
// Report either the success or failure of our mission
- buf = new StringBuffer();
+ buf = new StringBuilder();
if (errMsg != null && errMsg.length() > 0) {
String errorDesc = AutotoolsPlugin.getResourceString("MakeGenerator.generation.error"); //$NON-NLS-1$
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
@@ -1172,7 +1172,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
"MakeGenerator.make.message", msgs)); //$NON-NLS-1$
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
// Launch command - main invocation
if (consoleStart)
@@ -1302,7 +1302,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
}
// Report either the success or failure of our mission
- buf = new StringBuffer();
+ buf = new StringBuilder();
if (errMsg != null && errMsg.length() > 0) {
String errorDesc = AutotoolsPlugin.getResourceString("MakeGenerator.generation.error"); //$NON-NLS-1$
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
index 42ad8f0f91..f3e4162b8c 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
@@ -293,7 +293,7 @@ public class AutotoolsConfiguration implements IAConfiguration {
@Override
public String getToolParameters(String name) {
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
Option[] options = getChildOptions(name);
for (int i = 0; i < options.length; ++i) {
IConfigureOption option = getOption(options[i].getName());
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
index e7ae6a328b..e2066d5e2b 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Red Hat Inc.
+ * Copyright (c) 2011, 2016 Red Hat Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,14 +37,14 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
@Override
public String getParameter() {
- StringBuffer parms = new StringBuffer();
+ StringBuilder parms = new StringBuilder();
// Multiple flags are designated by putting multiple flags together using "|" as delimiter
String[] flagNames = getValue().split("\\|"); //$NON-NLS-1$
String flagSeparator = "";
for (String flagName : flagNames) {
parms.append(flagSeparator);
flagSeparator = " "; //$NON-NLS-1$
- StringBuffer parm = new StringBuffer(flagName+"=\""); //$NON-NLS-1$
+ StringBuilder parm = new StringBuilder(flagName+"=\""); //$NON-NLS-1$
boolean haveParm = false;
if (isParmSet()) {
String separator = "";

Back to the top