Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAlex Blewitt2016-04-22 23:00:51 +0000
committerSergey Prigogin2016-04-25 16:38:47 +0000
commit6bdca5f4a2598b1206d51a59b720314a2f7aa3c1 (patch)
tree6c94852b1cf0abc24dcb1af3ef1526e89314bbe2 /build
parente21fc12f9052e99dcf545df4a2ae2aba1c90c1cc (diff)
downloadorg.eclipse.cdt-6bdca5f4a2598b1206d51a59b720314a2f7aa3c1.tar.gz
org.eclipse.cdt-6bdca5f4a2598b1206d51a59b720314a2f7aa3c1.tar.xz
org.eclipse.cdt-6bdca5f4a2598b1206d51a59b720314a2f7aa3c1.zip
Bug 492230 - Replace buffer.append(a+b) calls
When using a `StringBuilder` or `StringBuffer` to create a string message, using implicit string concatenation inside an `.append()` call will create a nested StringBuilder for the purposes of creating the arguments, which will subsequently be converted to a String and then passed to the outer StringBuilder. Skip the creation of the intermediate object and String by simply replacing such calls with `buffer.append(a).append(b)`. Where values are compile time String constants, leave as is so that the javac compiler can perform compile-time String concatenation. Ensure that NEWLINE isn't appended in such a way since it is not a compile time constant `System.getProperty("line.separator")` Change-Id: I4126aefb2272f06b08332e004d7ea76b6f02cdba Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java4
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java10
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java14
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/actions/AbstractAutotoolsHandler.java6
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeTextHover.java4
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/text/hover/AutoconfTextHover.java15
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ManagedBuildTestHelper.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ResourceDeltaVerifier.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CustomOptionCommandGenerator.java9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/Test30_2_CommandLineGenerator.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java14
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java47
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java207
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingUI.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java8
21 files changed, 200 insertions, 188 deletions
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 f3e4162b8c5..065bd712b10 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
@@ -303,12 +303,12 @@ public class AutotoolsConfiguration implements IAConfiguration {
IConfigureOption childOption = getOption(childOptions[j].getName());
String parameter = childOption.getParameter();
if (!parameter.isEmpty())
- buf.append(" " + parameter);
+ buf.append(' ').append(parameter);
}
} else {
String parameter = option.getParameter();
if (!parameter.isEmpty())
- buf.append(" " + parameter);
+ buf.append(' ').append(parameter);
}
}
return buf.toString();
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 e2066d5e2bc..6abc667257a 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
@@ -44,23 +44,23 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
for (String flagName : flagNames) {
parms.append(flagSeparator);
flagSeparator = " "; //$NON-NLS-1$
- StringBuilder parm = new StringBuilder(flagName+"=\""); //$NON-NLS-1$
+ StringBuilder parm = new StringBuilder(flagName).append("=\""); //$NON-NLS-1$
boolean haveParm = false;
if (isParmSet()) {
- String separator = "";
+ String separator = ""; //$NON-NLS-1$
for (int i = 0; i < children.size(); ++i) {
String fvname = children.get(i);
IConfigureOption o = cfg.getOption(fvname);
if (o.isParmSet()) {
if (o instanceof IFlagConfigureValueOption) {
- parm.append(separator + ((IFlagConfigureValueOption)o).getFlags()); //$NON-NLS-1$
- separator = " ";
+ parm.append(separator).append(((IFlagConfigureValueOption)o).getFlags());
+ separator = " "; //$NON-NLS-1$
haveParm = true;
}
}
}
if (haveParm) {
- parm.append("\""); //$NON-NLS-1$
+ parm.append('"');
parms.append(parm);
}
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java
index 4de4a5257e7..000f36ca68d 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java
@@ -41,25 +41,21 @@ public class AutoconfPartitioner extends FastPartitioner {
public void printPartitions(ITypedRegion[] partitions)
{
- StringBuilder buffer = new StringBuilder();
-
for (int i = 0; i < partitions.length; i++)
{
try
{
- buffer.append("Partition type: " + partitions[i].getType() //$NON-NLS-1$
+ System.out.print("Partition type: " + partitions[i].getType() //$NON-NLS-1$
+ ", offset: " + partitions[i].getOffset() //$NON-NLS-1$
- + ", length: " + partitions[i].getLength()); //$NON-NLS-1$
- buffer.append("\n"); //$NON-NLS-1$
- buffer.append("Text:\n"); //$NON-NLS-1$
- buffer.append(super.fDocument.get(partitions[i].getOffset(), partitions[i].getLength()));
- buffer.append("\n---------------------------\n\n\n"); //$NON-NLS-1$
+ + ", length: " + partitions[i].getLength() //$NON-NLS-1$
+ +"\nText:\n" //$NON-NLS-1$
+ + super.fDocument.get(partitions[i].getOffset(), partitions[i].getLength())
+ + "\n---------------------------\n\n\n"); //$NON-NLS-1$
}
catch (BadLocationException e)
{
e.printStackTrace();
}
}
- System.out.print(buffer);
}
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/actions/AbstractAutotoolsHandler.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/actions/AbstractAutotoolsHandler.java
index 82ddf6719de..1de726c5ae2 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/actions/AbstractAutotoolsHandler.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/actions/AbstractAutotoolsHandler.java
@@ -130,7 +130,7 @@ public abstract class AbstractAutotoolsHandler extends AbstractHandler {
if (currentWord.startsWith("'")) { //$NON-NLS-1$
StringBuilder tmpTarget = new StringBuilder();
while (!currentWord.endsWith("'")) { //$NON-NLS-1$
- tmpTarget.append(currentWord + " "); //$NON-NLS-1$
+ tmpTarget.append(currentWord).append(' ');
if (!st.hasMoreTokens()) {
// quote not closed properly, so return null
return null;
@@ -146,7 +146,7 @@ public abstract class AbstractAutotoolsHandler extends AbstractHandler {
if (currentWord.startsWith("\"")) { //$NON-NLS-1$
StringBuilder tmpTarget = new StringBuilder();
while (!currentWord.endsWith("\"")) { //$NON-NLS-1$
- tmpTarget.append(currentWord + " "); //$NON-NLS-1$
+ tmpTarget.append(currentWord).append(' ');
if (!st.hasMoreTokens()) {
// double quote not closed properly, so return null
return null;
@@ -340,7 +340,7 @@ public abstract class AbstractAutotoolsHandler extends AbstractHandler {
// POSIX-compliant shells.
StringBuilder command1 = new StringBuilder(strippedCommand);
for (String arg : argumentList) {
- command1.append(" " + arg);
+ command1.append(' ').append(arg);
}
newArgumentList = new String[] { "-c", command1.toString() };
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeTextHover.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeTextHover.java
index 86bb102ba7c..74b124508e6 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeTextHover.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeTextHover.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2016 Red Hat Inc..
+ * Copyright (c) 2006, 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
@@ -76,7 +76,7 @@ public class AutomakeTextHover implements ITextHover, ITextHoverExtension {
StringBuilder toReturn = new StringBuilder();
toReturn.append(preReqs[0]);
for (int i = 1; i < preReqs.length; i++) {
- toReturn.append(" " + preReqs[i]);
+ toReturn.append(' ').append(preReqs[i]);
}
return toReturn.toString();
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/text/hover/AutoconfTextHover.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/text/hover/AutoconfTextHover.java
index c6e37a7a4de..a1891e7a52a 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/text/hover/AutoconfTextHover.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/text/hover/AutoconfTextHover.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2016 Red Hat, Inc.
+ * Copyright (c) 2006, 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
@@ -294,7 +294,7 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
Element elem = document.getElementById(name);
if (null != elem) {
int prototypeCount = 0;
- buffer.append("<B>Macro:</B> " + name);
+ buffer.append("<B>Macro:</B> ").append(name);
NodeList nl = elem.getChildNodes();
for (int i = 0; i < nl.getLength(); ++i) {
Node n = nl.item(i);
@@ -304,8 +304,11 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
++prototypeCount;
if (prototypeCount == 1) {
buffer.append(" (");
- } else
- buffer.append(" <B>or</B> " + name + " (<I>"); //$NON-NLS-2$
+ } else {
+ buffer.append(" <B>or</B> "); //$NON-NLS-2$
+ buffer.append(name);
+ buffer.append(" (<I>"); //$NON-NLS-2$
+ }
NodeList varList = n.getChildNodes();
for (int j = 0; j < varList.getLength(); ++j) {
Node v = varList.item(j);
@@ -317,10 +320,10 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
if (prototype.length() == 0)
prototype.append(parm);
else
- prototype.append(", " + parm);
+ prototype.append(", ").append(parm);
}
}
- buffer.append(prototype.toString() + "</I>)<br>"); //$NON-NLS-1$
+ buffer.append(prototype).append("</I>)<br>"); //$NON-NLS-1$
}
if (nodeName.equals("synopsis")) { //$NON-NLS-1$
Node textNode = n.getLastChild();
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java
index ce66ce5ad19..10200464617 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java
@@ -77,7 +77,9 @@ public class SCDMakefileGenerator extends DefaultRunSIProvider {
buffer.append(DENDL);
buffer.append("COMMANDS := "); //$NON-NLS-1$
for (CCommandDSC cmd : commands) {
- buffer.append("\t\\"+ENDL+"\t scd_cmd_"); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("\t\\"); //$NON-NLS-1$
+ buffer.append(ENDL);
+ buffer.append("\t scd_cmd_"); //$NON-NLS-1$
buffer.append(cmd.getCommandId());
}
buffer.append(DENDL);
@@ -88,7 +90,9 @@ public class SCDMakefileGenerator extends DefaultRunSIProvider {
buffer.append(cmd.getCommandId());
buffer.append(':');
buffer.append(ENDL);
- buffer.append("\t@echo begin generating scanner info for $@"+ENDL+"\t"); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("\t@echo begin generating scanner info for $@"); //$NON-NLS-1$
+ buffer.append(ENDL);
+ buffer.append('\t');
buffer.append(cmd.getSCDRunnableCommand(true, true)); // quote includes and defines
for (String arg : prepareArguments(buildInfo.isUseDefaultProviderCommand(providerId))) {
buffer.append(' ');
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java
index 0b2a1c1d408..13a03132da7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Broadcom Corporation and others.
+ * Copyright (c) 2011, 2016 Broadcom Corporation 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
@@ -236,7 +236,7 @@ public abstract class AbstractBuilderTest extends TestCase {
int i = 0;
// line number
if (attrs[i] != null)
- sb.append(" line " + attrs[i]);
+ sb.append(" line ").append(attrs[i]); //$NON-NLS-1$
// severity
if (attrs[++i] != null) {
switch ((Integer)attrs[i++]) {
@@ -254,7 +254,7 @@ public abstract class AbstractBuilderTest extends TestCase {
// append the rest of the string fields
do {
if (attrs[i] != null)
- sb.append(" " + attrs[i]);
+ sb.append(' ').append(attrs[i]);
} while (++i < attrs.length);
// Finally print the string
System.err.println(sb.toString());
@@ -275,4 +275,4 @@ public abstract class AbstractBuilderTest extends TestCase {
return ResourcesPlugin.getWorkspace();
}
-} \ No newline at end of file
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ManagedBuildTestHelper.java b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ManagedBuildTestHelper.java
index 2d8da8a6ef7..c5c51af35ab 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ManagedBuildTestHelper.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ManagedBuildTestHelper.java
@@ -463,10 +463,10 @@ public class ManagedBuildTestHelper {
StringBuffer buffer = new StringBuffer();
buffer.append("File ").append(testFileLocation.lastSegment()).append(" does not match its benchmark.\n ");
buffer.append("expected:\n ");
- buffer.append("\"").append(benchmarkBuffer).append("\"");
+ buffer.append('"').append(benchmarkBuffer).append('"');
buffer.append("\n\n ");
buffer.append("but was:\n ");
- buffer.append("\"").append(testBuffer).append("\"");
+ buffer.append('"').append(testBuffer).append('"');
buffer.append("\n\n ");
buffer.append(">>>>>>>>>>>>>>>start diff: \n");
@@ -787,10 +787,10 @@ public class ManagedBuildTestHelper {
StringBuffer buffer = new StringBuffer();
buffer.append("File ").append(tFile.getName()).append(" does not match its benchmark.\n ");
buffer.append("expected:\n ");
- buffer.append("\"").append(benchmarkBuffer).append("\"");
+ buffer.append('"').append(benchmarkBuffer).append('"');
buffer.append("\n\n ");
buffer.append("but was:\n ");
- buffer.append("\"").append(testBuffer).append("\"");
+ buffer.append('"').append(testBuffer).append('"');
buffer.append("\n\n ");
buffer.append(">>>>>>>>>>>>>>>start diff: \n");
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ResourceDeltaVerifier.java b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ResourceDeltaVerifier.java
index ad686f91bfe..5d09fc62283 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ResourceDeltaVerifier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/ResourceDeltaVerifier.java
@@ -538,7 +538,8 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
checkChildren(delta);
} catch (Exception e) {
e.printStackTrace();
- fMessage.append("Exception during event notification:" + e.getMessage());
+ fMessage.append("Exception during event notification:");
+ fMessage.append(e.getMessage());
fIsDeltaValid = false;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CustomOptionCommandGenerator.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CustomOptionCommandGenerator.java
index c9b025538ef..d9273f5c109 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CustomOptionCommandGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CustomOptionCommandGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Texas Instruments and others.
+ * Copyright (c) 2011, 2016 Texas Instruments 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
@@ -34,11 +34,14 @@ public class CustomOptionCommandGenerator implements IOptionCommandGenerator
if(list != null) {
StringBuilder sb = new StringBuilder();
+ sb.append(option.getCommand()).append('"');
+
for(String entry : list) {
- sb.append(entry + ';');
+ sb.append(entry).append(';');
}
- return option.getCommand() + '\"' + sb.toString() + '\"';
+ sb.append('"');
+ return sb.toString();
}
}
catch(Exception x) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/Test30_2_CommandLineGenerator.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/Test30_2_CommandLineGenerator.java
index e2340881c17..3217401d838 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/Test30_2_CommandLineGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/Test30_2_CommandLineGenerator.java
@@ -102,7 +102,7 @@ public class Test30_2_CommandLineGenerator implements
else if( varName.compareToIgnoreCase( OUTPUT_PREFIX_PRM_NAME ) == 0 ) sb.append( info.commandOutputPrefix.trim() );
else if( varName.compareToIgnoreCase( OUTPUT_PRM_NAME ) == 0 ) sb.append( info.commandOutput.trim() );
else if( varName.compareToIgnoreCase( INPUTS_PRM_NAME ) == 0 ) sb.append( info.commandInputs );
- else sb.append( VAR_FIRST_CHAR + VAR_SECOND_CHAR + varName + VAR_FINAL_CHAR );
+ else sb.append(VAR_FIRST_CHAR).append(VAR_SECOND_CHAR).append(varName).append(VAR_FINAL_CHAR);
} catch( Exception ex ) {
// do nothing for a while
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java
index 2da809ebcfd..7d24e38b43c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java
@@ -87,10 +87,10 @@ public class DbgUtil {
IBuildIOType types[] = inputs ? step.getInputIOTypes() : step.getOutputIOTypes();
- buf.append("\n"); //$NON-NLS-1$
+ buf.append('\n');
for(int i = 0; i < types.length; i++){
- buf.append("ioType " + i + ":"); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append("ioType ").append(i).append(':'); //$NON-NLS-1$
buf.append(ioTypeResources(types[i]));
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java
index 39cfb460d33..00141b0915c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java
@@ -114,10 +114,13 @@ public class ManagedCommandLineGenerator implements
}
private String stringArrayToString( String[] array ) {
- if( array == null || array.length <= 0 ) return ""; // $NON-NLS-1$
+ if( array == null || array.length <= 0 ) return ""; //$NON-NLS-1$
StringBuilder sb = new StringBuilder();
- for( int i = 0; i < array.length; i++ )
- sb.append( array[i] + WHITESPACE );
+ for( int i = 0; i < array.length; i++ ) {
+ if(i > 0) // we add whitespace after each but not first so .trim() is a no-op
+ sb.append(WHITESPACE);
+ sb.append(array[i]);
+ }
return sb.toString().trim();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
index c8e9a76f0e4..368697c7b85 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
@@ -996,7 +996,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (browseFilterExtensions != null) {
StringBuilder sb = new StringBuilder();
for(String ext : browseFilterExtensions) {
- sb.append(ext + ',');
+ sb.append(ext).append(',');
}
element.setAttribute(BROWSE_FILTER_EXTENSIONS, sb.toString());
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
index fd8c4d594d6..92f5e97c252 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
@@ -2707,7 +2707,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if(list != null){
for (String temp : list) {
if(temp.length() > 0 && !temp.equals(EMPTY_QUOTED_STRING))
- sb.append( evaluateCommand( listCmd, temp ) + WHITE_SPACE );
+ sb.append( evaluateCommand( listCmd, temp ) ).append( WHITE_SPACE );
}
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
index 73af0f0456a..8feda5ee498 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
@@ -510,21 +510,21 @@ public class ToolReference implements IToolReference {
boolCmd = option.getCommandFalse();
}
if (boolCmd != null && boolCmd.length() > 0) {
- buf.append(boolCmd + WHITE_SPACE);
+ buf.append(boolCmd).append(WHITE_SPACE);
}
break;
case IOption.ENUMERATED :
String enumVal = option.getEnumCommand(option.getSelectedEnum());
if (enumVal.length() > 0) {
- buf.append(enumVal + WHITE_SPACE);
+ buf.append(enumVal).append(WHITE_SPACE);
}
break;
case IOption.TREE :
String treeVal = option.getCommand(option.getStringValue());
if (treeVal.length() > 0) {
- buf.append(treeVal + WHITE_SPACE);
+ buf.append(treeVal).append(WHITE_SPACE);
}
break;
@@ -533,7 +533,7 @@ public class ToolReference implements IToolReference {
String val = option.getStringValue();
if (val.length() > 0) {
if (strCmd != null) buf.append(strCmd);
- buf.append(val + WHITE_SPACE);
+ buf.append(val).append(WHITE_SPACE);
}
break;
@@ -543,7 +543,7 @@ public class ToolReference implements IToolReference {
for (int j = 0; j < list.length; j++) {
String temp = list[j];
if (cmd != null) buf.append(cmd);
- buf.append(temp + WHITE_SPACE);
+ buf.append(temp).append(WHITE_SPACE);
}
break;
@@ -552,7 +552,7 @@ public class ToolReference implements IToolReference {
String[] paths = option.getIncludePaths();
for (int j = 0; j < paths.length; j++) {
String temp = paths[j];
- buf.append(incCmd + temp + WHITE_SPACE);
+ buf.append(incCmd).append(temp).append(WHITE_SPACE);
}
break;
@@ -561,7 +561,7 @@ public class ToolReference implements IToolReference {
String[] symbols = option.getDefinedSymbols();
for (int j = 0; j < symbols.length; j++) {
String temp = symbols[j];
- buf.append(defCmd + temp + WHITE_SPACE);
+ buf.append(defCmd).append(temp).append(WHITE_SPACE);
}
break;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java
index 7a2cff762e4..229dea84d84 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java
@@ -35,7 +35,6 @@ import org.eclipse.core.resources.IResource;
*/
public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerator {
- private static final String EMPTY_STRING = ""; // $NON-NLS-1$
private static final String[] EMPTY_STRING_ARRAY = new String[0];
public final String WHITESPACE = " "; //$NON-NLS-1$
@@ -80,7 +79,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
// Work out the build-relative path for the output files
IContainer resourceLocation = resource.getParent();
- String relativePath = ""; // $NON-NLS-1$
+ String relativePath = ""; //$NON-NLS-1$
if (resourceLocation != null) {
relativePath += resourceLocation.getProjectRelativePath().toString();
}
@@ -96,23 +95,24 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
IManagedBuilderMakefileGenerator.DEP_EXT +
")'"; //$NON-NLS-1$
+ // Note that X + Y are in-lineable constants by the compiler
// Add the rule that will actually create the right format for the dep
- buffer.append(IManagedBuilderMakefileGenerator.TAB +
- IManagedBuilderMakefileGenerator.ECHO +
- IManagedBuilderMakefileGenerator.WHITESPACE +
- "-n" + //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.WHITESPACE +
- depRule +
- IManagedBuilderMakefileGenerator.WHITESPACE +
- "$(dir $@)" + //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.WHITESPACE +
- ">" + //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.WHITESPACE +
- depRule +
- IManagedBuilderMakefileGenerator.WHITESPACE +
- IManagedBuilderMakefileGenerator.LOGICAL_AND +
- IManagedBuilderMakefileGenerator.WHITESPACE +
- IManagedBuilderMakefileGenerator.LINEBREAK);
+ buffer.append(IManagedBuilderMakefileGenerator.TAB
+ + IManagedBuilderMakefileGenerator.ECHO
+ + IManagedBuilderMakefileGenerator.WHITESPACE
+ + "-n" //$NON-NLS-1$
+ + IManagedBuilderMakefileGenerator.WHITESPACE)
+ .append(depRule)
+ .append(IManagedBuilderMakefileGenerator.WHITESPACE
+ + "$(dir $@)" //$NON-NLS-1$
+ + IManagedBuilderMakefileGenerator.WHITESPACE
+ + ">"
+ + IManagedBuilderMakefileGenerator.WHITESPACE)
+ .append(depRule)
+ .append(IManagedBuilderMakefileGenerator.WHITESPACE
+ + IManagedBuilderMakefileGenerator.LOGICAL_AND
+ + IManagedBuilderMakefileGenerator.WHITESPACE
+ + IManagedBuilderMakefileGenerator.LINEBREAK);
// Add the line that will do the work to calculate dependencies
IManagedCommandLineInfo cmdLInfo = null;
@@ -293,11 +293,12 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
}
}
- buffer.append(IManagedBuilderMakefileGenerator.TAB +
- buildCmd +
- IManagedBuilderMakefileGenerator.WHITESPACE +
- ">>" + //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.WHITESPACE + depRule );
+ buffer.append(IManagedBuilderMakefileGenerator.TAB)
+ .append(buildCmd)
+ .append(IManagedBuilderMakefileGenerator.WHITESPACE
+ + ">>" //$NON-NLS-1$
+ + IManagedBuilderMakefileGenerator.WHITESPACE)
+ .append(depRule);
return buffer.toString();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
index fd351aa84f3..83d82e4cbff 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
@@ -1057,7 +1057,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Write every macro to the file
for (Entry<String, List<String>> entry : outputMacros.entrySet()) {
- macroBuffer.append(entry.getKey() + " :="); //$NON-NLS-1$
+ macroBuffer.append(entry.getKey()).append(" :="); //$NON-NLS-1$
valueList = entry.getValue();
for (String path : valueList) {
// These macros will also be used within commands.
@@ -1152,16 +1152,16 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Add the macros to the makefile
for (Entry<String, List<IPath>> entry : buildSrcVars.entrySet()) {
String macroName = entry.getKey();
- buffer.append(macroName + WHITESPACE + ":=" + WHITESPACE + NEWLINE); //$NON-NLS-1$
+ buffer.append(macroName).append(WHITESPACE).append(":=").append(WHITESPACE).append(NEWLINE); //$NON-NLS-1$
}
Set<Entry<String, List<IPath>>> set = buildOutVars.entrySet();
for (Entry<String, List<IPath>> entry : set) {
String macroName = entry.getKey();
- buffer.append(macroName + WHITESPACE + ":=" + WHITESPACE + NEWLINE); //$NON-NLS-1$
+ buffer.append(macroName).append(WHITESPACE).append(":=").append(WHITESPACE).append(NEWLINE); //$NON-NLS-1$
}
// Add a list of subdirectories to the makefile
- buffer.append(NEWLINE + addSubdirectories());
+ buffer.append(NEWLINE).append(addSubdirectories());
// Save the file
save(buffer, fileHandle);
@@ -1217,11 +1217,11 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
StringBuffer buffer = new StringBuffer();
// Add the ROOT macro
- //buffer.append("ROOT := .." + NEWLINE); //$NON-NLS-1$
+ //buffer.append("ROOT := ..").append(NEWLINE); //$NON-NLS-1$
//buffer.append(NEWLINE);
// include makefile.init supplementary makefile
- buffer.append("-include " + ROOT + SEPARATOR + MAKEFILE_INIT + NEWLINE); //$NON-NLS-1$
+ buffer.append("-include " + ROOT + SEPARATOR + MAKEFILE_INIT).append(NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
// Get the clean command from the build model
@@ -1238,13 +1238,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
} catch (BuildMacroException e) {
}
- buffer.append(cleanCommand + NEWLINE);
+ buffer.append(cleanCommand).append(NEWLINE);
buffer.append(NEWLINE);
// Now add the source providers
- buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(SRC_LISTS) + NEWLINE);
- buffer.append("-include sources.mk" + NEWLINE); //$NON-NLS-1$
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(SRC_LISTS)).append(NEWLINE);
+ buffer.append("-include sources.mk").append(NEWLINE); //$NON-NLS-1$
// Add includes for each subdir in child-subdir-first order (required for makefile rule matching to work).
List<String> subDirList = new ArrayList<String>();
@@ -1255,33 +1255,33 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
Collections.sort(subDirList, Collections.reverseOrder());
for (String dir : subDirList) {
- buffer.append("-include " + escapeWhitespaces(dir) + SEPARATOR + "subdir.mk"+ NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("-include ").append(escapeWhitespaces(dir)).append(SEPARATOR).append("subdir.mk").append(NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
}
- buffer.append("-include subdir.mk" + NEWLINE); //$NON-NLS-1$
+ buffer.append("-include subdir.mk").append(NEWLINE); //$NON-NLS-1$
- buffer.append("-include objects.mk" + NEWLINE + NEWLINE); //$NON-NLS-1$
+ buffer.append("-include objects.mk").append(NEWLINE).append(NEWLINE); //$NON-NLS-1$
// Include generated dependency makefiles if non-empty AND a "clean" has not been requested
if (!buildDepVars.isEmpty()) {
- buffer.append("ifneq ($(MAKECMDGOALS),clean)" + NEWLINE); //$NON-NLS-1$
+ buffer.append("ifneq ($(MAKECMDGOALS),clean)").append(NEWLINE); //$NON-NLS-1$
for (Entry<String, GnuDependencyGroupInfo> entry : buildDepVars.entrySet()) {
String depsMacro = entry.getKey();
GnuDependencyGroupInfo info = entry.getValue();
- buffer.append("ifneq ($(strip $(" + depsMacro + ")),)" + NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("ifneq ($(strip $(").append(depsMacro).append(")),)").append(NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
if (info.conditionallyInclude) {
- buffer.append("-include $(" + depsMacro + ")" + NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("-include $(").append(depsMacro).append(')').append(NEWLINE); //$NON-NLS-1$
} else {
- buffer.append("include $(" + depsMacro + ")" + NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("include $(").append(depsMacro).append(')').append(NEWLINE); //$NON-NLS-1$
}
- buffer.append("endif" + NEWLINE); //$NON-NLS-1$
+ buffer.append("endif").append(NEWLINE); //$NON-NLS-1$
}
- buffer.append("endif" + NEWLINE + NEWLINE); //$NON-NLS-1$
+ buffer.append("endif").append(NEWLINE).append(NEWLINE); //$NON-NLS-1$
}
// Include makefile.defs supplemental makefile
- buffer.append("-include " + ROOT + SEPARATOR + MAKEFILE_DEFS + NEWLINE); //$NON-NLS-1$
+ buffer.append("-include ").append(ROOT).append(SEPARATOR).append(MAKEFILE_DEFS).append(NEWLINE); //$NON-NLS-1$
return (buffer.append(NEWLINE));
@@ -1359,10 +1359,10 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (prebuildStep.length() > 0) {
// Add the comment for the "All" target
- buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(ALL_TARGET) + NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(ALL_TARGET)).append(NEWLINE);
- buffer.append(defaultTarget + WHITESPACE);
- buffer.append(PREBUILD + WHITESPACE);
+ buffer.append(defaultTarget).append(WHITESPACE);
+ buffer.append(PREBUILD).append(WHITESPACE);
// Reset defaultTarget for now and for subsequent use, below
defaultTarget = MAINBUILD;
@@ -1371,14 +1371,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Update the defaultTarget, main-build, by adding a colon, which is
// needed below
defaultTarget = defaultTarget.concat(COLON);
- buffer.append(NEWLINE + NEWLINE);
+ buffer.append(NEWLINE).append(NEWLINE);
// Add the comment for the "main-build" target
- buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(MAINBUILD_TARGET) + NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MAINBUILD_TARGET)).append(NEWLINE);
}
else
// Add the comment for the "All" target
- buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(ALL_TARGET) + NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(ALL_TARGET)).append(NEWLINE);
// Write out the all target first in case someone just runs make
// all: <target_name> or mainbuild: <target_name>
@@ -1387,19 +1387,19 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (targetTool != null) {
outputPrefix = targetTool.getOutputPrefix();
}
- buffer.append(defaultTarget + WHITESPACE + outputPrefix
- + ensurePathIsGNUMakeTargetRuleCompatibleSyntax(buildTargetName));
+ buffer.append(defaultTarget).append(WHITESPACE).append(outputPrefix)
+ .append(ensurePathIsGNUMakeTargetRuleCompatibleSyntax(buildTargetName));
if (buildTargetExt.length() > 0) {
- buffer.append(DOT + buildTargetExt);
+ buffer.append(DOT).append(buildTargetExt);
}
// Add the Secondary Outputs to the all target, if any
IOutputType[] secondaryOutputs = config.getToolChain().getSecondaryOutputs();
if (secondaryOutputs.length > 0) {
- buffer.append(WHITESPACE + SECONDARY_OUTPUTS);
+ buffer.append(WHITESPACE).append(SECONDARY_OUTPUTS);
}
- buffer.append(NEWLINE + NEWLINE);
+ buffer.append(NEWLINE).append(NEWLINE);
/*
* The build target may depend on other projects in the workspace. These
@@ -1419,7 +1419,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// if (!dep.exists()) continue;
if (addDeps) {
- buffer.append("dependents:" + NEWLINE); //$NON-NLS-1$
+ buffer.append("dependents:").append(NEWLINE); //$NON-NLS-1$
addDeps = false;
}
String buildDir = depCfg.getOwner().getLocation().toString();
@@ -1468,7 +1468,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
dependency = escapeWhitespaces(dependency);
managedProjectOutputs.add(dependency);
//}
- buffer.append(TAB + "-cd" + WHITESPACE + escapeWhitespaces(buildDir) + WHITESPACE + LOGICAL_AND + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append(TAB).append("-cd").append(WHITESPACE).append(escapeWhitespaces(buildDir)) //$NON-NLS-1$
+ .append(WHITESPACE).append(LOGICAL_AND).append(WHITESPACE).append("$(MAKE) ").append(depTargets).append(NEWLINE); //$NON-NLS-1$
}
// }
buffer.append(NEWLINE);
@@ -1480,51 +1481,51 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Add the prebuild step target, if specified
if (prebuildStep.length() > 0) {
- buffer.append(PREBUILD + COLON + NEWLINE);
+ buffer.append(PREBUILD).append(COLON).append(NEWLINE);
if (preannouncebuildStep.length() > 0) {
- buffer.append(TAB + DASH + AT + escapedEcho(preannouncebuildStep));
+ buffer.append(TAB).append(DASH).append(AT).append(escapedEcho(preannouncebuildStep));
}
- buffer.append(TAB + DASH + prebuildStep + NEWLINE);
- buffer.append(TAB + DASH + AT + ECHO_BLANK_LINE + NEWLINE);
+ buffer.append(TAB).append(DASH).append(prebuildStep).append(NEWLINE);
+ buffer.append(TAB).append(DASH).append(AT).append(ECHO_BLANK_LINE).append(NEWLINE);
}
// Add the postbuild step, if specified
if (postbuildStep.length() > 0) {
- buffer.append(POSTBUILD + COLON + NEWLINE);
+ buffer.append(POSTBUILD).append(COLON).append(NEWLINE);
if (postannouncebuildStep.length() > 0) {
- buffer.append(TAB + DASH + AT + escapedEcho(postannouncebuildStep));
+ buffer.append(TAB).append(DASH).append(AT).append(escapedEcho(postannouncebuildStep));
}
- buffer.append(TAB + DASH + postbuildStep + NEWLINE);
- buffer.append(TAB + DASH + AT + ECHO_BLANK_LINE + NEWLINE);
+ buffer.append(TAB).append(DASH).append(postbuildStep).append(NEWLINE);
+ buffer.append(TAB).append(DASH).append(AT).append(ECHO_BLANK_LINE).append(NEWLINE);
}
// Add the Secondary Outputs target, if needed
if (secondaryOutputs.length > 0) {
- buffer.append(SECONDARY_OUTPUTS + COLON);
+ buffer.append(SECONDARY_OUTPUTS).append(COLON);
Vector<String> outs2 = calculateSecondaryOutputs(secondaryOutputs);
for (int i=0; i<outs2.size(); i++) {
- buffer.append(WHITESPACE + "$(" + outs2.get(i) + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append(WHITESPACE).append("$(").append(outs2.get(i)).append(')'); //$NON-NLS-1$
}
- buffer.append(NEWLINE + NEWLINE);
+ buffer.append(NEWLINE).append(NEWLINE);
}
// Add all the needed dummy and phony targets
- buffer.append(".PHONY: all clean dependents" + NEWLINE); //$NON-NLS-1$
+ buffer.append(".PHONY: all clean dependents").append(NEWLINE); //$NON-NLS-1$
buffer.append(".SECONDARY:"); //$NON-NLS-1$
if (prebuildStep.length() > 0) {
- buffer.append(WHITESPACE + MAINBUILD + WHITESPACE + PREBUILD);
+ buffer.append(WHITESPACE).append(MAINBUILD).append(WHITESPACE).append(PREBUILD);
}
if (postbuildStep.length() > 0) {
- buffer.append(WHITESPACE + POSTBUILD);
+ buffer.append(WHITESPACE).append(POSTBUILD);
}
buffer.append(NEWLINE);
for (String output : managedProjectOutputs) {
- buffer.append(output + COLON + NEWLINE);
+ buffer.append(output).append(COLON).append(NEWLINE);
}
buffer.append(NEWLINE);
// Include makefile.targets supplemental makefile
- buffer.append("-include " + ROOT + SEPARATOR + MAKEFILE_TARGETS + NEWLINE); //$NON-NLS-1$
+ buffer.append("-include ").append(ROOT).append(SEPARATOR).append(MAKEFILE_TARGETS).append(NEWLINE); //$NON-NLS-1$
return buffer;
}
@@ -1543,7 +1544,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
List<String> outputVarsAdditionsList, Vector<String> managedProjectOutputs, boolean postbuildStep) {
StringBuffer buffer = new StringBuffer();
// Add the comment
- buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(BUILD_TOP) + NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(BUILD_TOP)).append(NEWLINE);
ToolInfoHolder h = (ToolInfoHolder)toolInfos.getValue();
ITool[] buildTools = h.buildTools;
@@ -1564,7 +1565,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
}
} else {
- buffer.append(TAB + AT + escapedEcho(MESSAGE_NO_TARGET_TOOL + WHITESPACE + OUT_MACRO));
+ buffer.append(TAB).append(AT).append(escapedEcho(MESSAGE_NO_TARGET_TOOL + WHITESPACE + OUT_MACRO));
}
// Generate the rules for all Tools that specify InputType.multipleOfType, and any Tools that
@@ -1585,14 +1586,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
// Add the comment
- buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(BUILD_TARGETS) + NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(BUILD_TARGETS)).append(NEWLINE);
// Always add a clean target
- buffer.append("clean:" + NEWLINE); //$NON-NLS-1$
- buffer.append(TAB + "-$(RM)" + WHITESPACE); //$NON-NLS-1$
+ buffer.append("clean:").append(NEWLINE); //$NON-NLS-1$
+ buffer.append(TAB).append("-$(RM)").append(WHITESPACE); //$NON-NLS-1$
for (Entry<String, List<IPath>> entry : buildOutVars.entrySet()) {
String macroName = entry.getKey();
- buffer.append("$(" + macroName + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("$(").append(macroName).append(')'); //$NON-NLS-1$
}
String outputPrefix = EMPTY_STRING;
if (targetTool != null) {
@@ -1603,12 +1604,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
completeBuildTargetName = completeBuildTargetName + DOT + buildTargetExt;
}
if (completeBuildTargetName.contains(" ")) { //$NON-NLS-1$
- buffer.append(WHITESPACE + "\"" + completeBuildTargetName + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append(WHITESPACE).append('"').append(completeBuildTargetName).append('"');
} else {
- buffer.append(WHITESPACE + completeBuildTargetName);
+ buffer.append(WHITESPACE).append(completeBuildTargetName);
}
buffer.append(NEWLINE);
- buffer.append(TAB + DASH + AT + ECHO_BLANK_LINE + NEWLINE);
+ buffer.append(TAB).append(DASH).append(AT).append(ECHO_BLANK_LINE).append(NEWLINE);
return buffer;
}
@@ -1687,11 +1688,11 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
else {
getRuleList().add(buildRule);
- buffer.append(buildRule + NEWLINE);
+ buffer.append(buildRule).append(NEWLINE);
if (bTargetTool) {
- buffer.append(TAB + AT + escapedEcho(MESSAGE_START_BUILD + WHITESPACE + OUT_MACRO));
+ buffer.append(TAB).append(AT).append(escapedEcho(MESSAGE_START_BUILD + WHITESPACE + OUT_MACRO));
}
- buffer.append(TAB + AT + escapedEcho(tool.getAnnouncement()));
+ buffer.append(TAB).append(AT).append(escapedEcho(tool.getAnnouncement()));
// Get the command line for this tool invocation
String[] flags;
@@ -1750,23 +1751,23 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
- //buffer.append(TAB + AT + escapedEcho(buildCmd));
- //buffer.append(TAB + AT + buildCmd);
- buffer.append(TAB + buildCmd);
+ //buffer.append(TAB).append(AT).append(escapedEcho(buildCmd));
+ //buffer.append(TAB).append(AT).append(buildCmd);
+ buffer.append(TAB).append(buildCmd);
// TODO
// NOTE WELL: Dependency file generation is not handled for this type of Tool
// Echo finished message
buffer.append(NEWLINE);
- buffer.append(TAB + AT + escapedEcho((bTargetTool ? MESSAGE_FINISH_BUILD : MESSAGE_FINISH_FILE) + WHITESPACE + OUT_MACRO));
- buffer.append(TAB + AT + ECHO_BLANK_LINE);
+ buffer.append(TAB).append(AT).append(escapedEcho((bTargetTool ? MESSAGE_FINISH_BUILD : MESSAGE_FINISH_FILE) + WHITESPACE + OUT_MACRO));
+ buffer.append(TAB).append(AT).append(ECHO_BLANK_LINE);
// If there is a post build step, then add a recursive invocation of MAKE to invoke it after the main build
// Note that $(MAKE) will instantiate in the recusive invocation to the make command that was used to invoke
// the makefile originally
if (bEmitPostBuildStepCall) {
- buffer.append(TAB + MAKE + WHITESPACE + NO_PRINT_DIR + WHITESPACE + POSTBUILD + NEWLINE + NEWLINE);
+ buffer.append(TAB).append(MAKE).append(WHITESPACE).append(NO_PRINT_DIR).append(WHITESPACE).append(POSTBUILD).append(NEWLINE).append(NEWLINE);
}
else {
// Just emit a blank line
@@ -1935,19 +1936,19 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
private StringBuffer addSubdirectories() {
StringBuffer buffer = new StringBuffer();
// Add the comment
- buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(MOD_LIST) + NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MOD_LIST)).append(NEWLINE);
- buffer.append("SUBDIRS := " + LINEBREAK); //$NON-NLS-1$
+ buffer.append("SUBDIRS := ").append(LINEBREAK); //$NON-NLS-1$
// Get all the module names
for (IResource container : getSubdirList()) {
updateMonitor(ManagedMakeMessages.getFormattedString("MakefileGenerator.message.adding.source.folder", container.getFullPath().toString())); //$NON-NLS-1$
// Check the special case where the module is the project root
if (container.getFullPath() == project.getFullPath()) {
- buffer.append(DOT + WHITESPACE + LINEBREAK);
+ buffer.append(DOT).append(WHITESPACE).append(LINEBREAK);
} else {
IPath path = container.getProjectRelativePath();
- buffer.append(escapeWhitespaces(path.toString()) + WHITESPACE + LINEBREAK);
+ buffer.append(escapeWhitespaces(path.toString())).append(WHITESPACE).append(LINEBREAK);
}
}
@@ -2024,7 +2025,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Write out the macro addition entries to the buffer
buffer.append(writeAdditionMacros(buildVarToRuleStringMap));
- return buffer.append(ruleBuffer + NEWLINE);
+ return buffer.append(ruleBuffer).append(NEWLINE);
}
/* (non-Javadoc
@@ -2596,9 +2597,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
getRuleList().add(buildRule);
// Echo starting message
- buffer.append(buildRule + NEWLINE);
- buffer.append(TAB + AT + escapedEcho(MESSAGE_START_FILE + WHITESPACE + IN_MACRO));
- buffer.append(TAB + AT + escapedEcho(tool.getAnnouncement()));
+ buffer.append(buildRule).append(NEWLINE);
+ buffer.append(TAB).append(AT).append(escapedEcho(MESSAGE_START_FILE + WHITESPACE + IN_MACRO));
+ buffer.append(TAB).append(AT).append(escapedEcho(tool.getAnnouncement()));
// If the tool specifies a dependency calculator of TYPE_BUILD_COMMANDS, ask whether
// there are any pre-tool commands.
@@ -2629,7 +2630,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
outputLocation, null, tool));
}
if (resolvedCommand != null)
- buffer.append(resolvedCommand + NEWLINE);
+ buffer.append(resolvedCommand).append(NEWLINE);
} catch (BuildMacroException e) {
}
}
@@ -2704,7 +2705,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
StringBuffer buildFlags = new StringBuffer();
for (String flag : flags) {
if( flag != null ) {
- buildFlags.append( flag + WHITESPACE );
+ buildFlags.append(flag).append(WHITESPACE);
}
}
buildCmd = cmd + WHITESPACE + buildFlags.toString().trim() + WHITESPACE + outflag + WHITESPACE +
@@ -2742,9 +2743,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
} catch (BuildMacroException e) {
}
- //buffer.append(TAB + AT + escapedEcho(buildCmd));
- //buffer.append(TAB + AT + buildCmd);
- buffer.append(TAB + buildCmd);
+ //buffer.append(TAB).append(AT).append(escapedEcho(buildCmd));
+ //buffer.append(TAB).append(AT).append(buildCmd);
+ buffer.append(TAB).append(buildCmd);
// Determine if there are any dependencies to calculate
if (doDepGen) {
@@ -2763,7 +2764,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
for (String depCmd : depCmds) {
// Resolve any macros in the dep command after it has been generated.
// Note: do not trim the result because it will strip out necessary tab characters.
- buffer.append(WHITESPACE + LOGICAL_AND + WHITESPACE + LINEBREAK);
+ buffer.append(WHITESPACE).append(LOGICAL_AND).append(WHITESPACE).append(LINEBREAK);
try {
if (!needExplicitRuleForFile) {
depCmd = ManagedBuildManager.getBuildMacroProvider()
@@ -2799,8 +2800,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Echo finished message
buffer.append(NEWLINE);
- buffer.append(TAB + AT + escapedEcho(MESSAGE_FINISH_FILE + WHITESPACE + IN_MACRO));
- buffer.append(TAB + AT + ECHO_BLANK_LINE + NEWLINE);
+ buffer.append(TAB).append(AT).append(escapedEcho(MESSAGE_FINISH_FILE + WHITESPACE + IN_MACRO));
+ buffer.append(TAB).append(AT).append(ECHO_BLANK_LINE).append(NEWLINE);
}
// Determine if there are calculated dependencies
@@ -2888,8 +2889,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (!getDepRuleList().contains(depLine)) {
getDepRuleList().add(depLine);
addedDepLines = true;
- buffer.append(depLine + NEWLINE);
- buffer.append(TAB + AT + escapedEcho(MESSAGE_START_DEPENDENCY + WHITESPACE + OUT_MACRO));
+ buffer.append(depLine).append(NEWLINE);
+ buffer.append(TAB).append(AT).append(escapedEcho(MESSAGE_START_DEPENDENCY + WHITESPACE + OUT_MACRO));
for (String preBuildCommand : preBuildCommands) {
depLine = preBuildCommand;
// Resolve macros
@@ -2920,13 +2921,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
} catch (BuildMacroException e) {
}
- //buffer.append(TAB + AT + escapedEcho(depLine));
- //buffer.append(TAB + AT + depLine + NEWLINE);
- buffer.append(TAB + depLine + NEWLINE);
+ //buffer.append(TAB).append(AT).append(escapedEcho(depLine));
+ //buffer.append(TAB).append(AT).append(depLine).append(NEWLINE);
+ buffer.append(TAB).append(depLine).append(NEWLINE);
}
}
if (addedDepLines) {
- buffer.append(TAB + AT + ECHO_BLANK_LINE + NEWLINE);
+ buffer.append(TAB).append(AT).append(ECHO_BLANK_LINE).append(NEWLINE);
}
}
}
@@ -3488,7 +3489,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// practically nil so it doesn't seem worth the hassle of generating a truly
// unique name.
if(extensionName.equals(extensionName.toUpperCase())) {
- macroName.append(extensionName.toUpperCase() + "_UPPER"); //$NON-NLS-1$
+ macroName.append(extensionName.toUpperCase()).append("_UPPER"); //$NON-NLS-1$
} else {
// lower case... no need for "UPPER_"
macroName.append(extensionName.toUpperCase());
@@ -3510,7 +3511,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// practically nil so it doesn't seem worth the hassle of generating a truly
// unique name.
if(extensionName.equals(extensionName.toUpperCase())) {
- macroName.append(extensionName.toUpperCase() + "_UPPER"); //$NON-NLS-1$
+ macroName.append(extensionName.toUpperCase()).append("_UPPER"); //$NON-NLS-1$
} else {
// lower case... no need for "UPPER_"
macroName.append(extensionName.toUpperCase());
@@ -3655,9 +3656,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
if (secondToken.startsWith("'")) { //$NON-NLS-1$
// This is the Win32 implementation of echo (MinGW without MSYS)
- outBuffer.append(secondToken.substring(1) + WHITESPACE);
+ outBuffer.append(secondToken.substring(1)).append(WHITESPACE);
} else {
- outBuffer.append(secondToken + WHITESPACE);
+ outBuffer.append(secondToken).append(WHITESPACE);
}
// The relative path to the build goal comes next
@@ -3691,15 +3692,15 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
} catch (ArrayIndexOutOfBoundsException e) {
fourthToken = ""; // $NON-NLS-1$
}
- outBuffer.append(fourthToken + WHITESPACE);
+ outBuffer.append(fourthToken).append(WHITESPACE);
// Followed by the actual dependencies
try {
for (String nextElement : deps) {
if (nextElement.endsWith("\\")) { //$NON-NLS-1$
- outBuffer.append(nextElement + NEWLINE + WHITESPACE);
+ outBuffer.append(nextElement).append(NEWLINE).append(WHITESPACE);
} else {
- outBuffer.append(nextElement + WHITESPACE);
+ outBuffer.append(nextElement).append(WHITESPACE);
}
}
} catch (IndexOutOfBoundsException e) {
@@ -3728,7 +3729,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* The formatting here is
* <dummy_target>:
*/
- outBuffer.append(dummy + COLON + NEWLINE + NEWLINE);
+ outBuffer.append(dummy).append(COLON).append(NEWLINE).append(NEWLINE);
}
}
@@ -3761,7 +3762,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
static protected StringBuffer addDefaultHeader() {
StringBuffer buffer = new StringBuffer();
outputCommentLine(buffer);
- buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(HEADER) + NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(HEADER)).append(NEWLINE);
outputCommentLine(buffer);
buffer.append(NEWLINE);
return buffer;
@@ -3812,9 +3813,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
protected void addMacroAdditionPrefix(LinkedHashMap<String, String> map, String macroName, String relativePath, boolean addPrefix) {
// there is no entry in the map, so create a buffer for this macro
StringBuffer tempBuffer = new StringBuffer();
- tempBuffer.append(macroName + WHITESPACE + MACRO_ADDITION_PREFIX_SUFFIX);
+ tempBuffer.append(macroName).append(WHITESPACE).append(MACRO_ADDITION_PREFIX_SUFFIX);
if (addPrefix) {
- tempBuffer.append(MACRO_ADDITION_ADDPREFIX_HEADER + relativePath + MACRO_ADDITION_ADDPREFIX_SUFFIX);
+ tempBuffer.append(MACRO_ADDITION_ADDPREFIX_HEADER).append(relativePath).append(MACRO_ADDITION_ADDPREFIX_SUFFIX);
}
// have to store the buffer in String form as StringBuffer is not a sublcass of Object
@@ -3833,7 +3834,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// escape whitespace in the filename
filename = escapeWhitespaces(filename);
- buffer.append(filename + WHITESPACE + LINEBREAK);
+ buffer.append(filename).append(WHITESPACE).append(LINEBREAK);
// re-insert string in the map
map.put(macroName, buffer.toString());
}
@@ -3885,7 +3886,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Bug 417288, ilg@livius.net & freidin.alex@gmail.com
filename = ensurePathIsGNUMakeTargetRuleCompatibleSyntax(filename);
- buffer.append(filename + WHITESPACE + LINEBREAK);
+ buffer.append(filename).append(WHITESPACE).append(LINEBREAK);
}
}
// re-insert string in the map
@@ -3898,7 +3899,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
protected StringBuffer writeAdditionMacros(LinkedHashMap<String, String> map) {
StringBuffer buffer = new StringBuffer();
// Add the comment
- buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(MOD_VARS) + NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MOD_VARS)).append(NEWLINE);
for (String macroString : map.values()) {
// Check if we added any files to the rule
@@ -3930,7 +3931,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
protected StringBuffer writeTopAdditionMacros(List<String> varList, HashMap<String, String> varMap) {
StringBuffer buffer = new StringBuffer();
// Add the comment
- buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(MOD_VARS) + NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MOD_VARS)).append(NEWLINE);
for (int i=0; i<varList.size(); i++) {
String addition = varMap.get(varList.get(i));
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingUI.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingUI.java
index c9a62333f23..83454113a28 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingUI.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingUI.java
@@ -361,7 +361,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
// If the parsed string does not match with any previous option
// values then consider this option as a additional build option
if (!optionValueExist) {
- addnOptions.append(optionValue + ITool.WHITE_SPACE);
+ addnOptions.append(optionValue).append(ITool.WHITE_SPACE);
}
}
// check whether some of the "STRING" option value or "OBJECTS" type
@@ -378,7 +378,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
String[] vals = val.split(WHITESPACE);
for (int t = 0; t < vals.length; t++) {
if (alloptions.indexOf(vals[t]) != -1)
- buf.append(vals[t] + ITool.WHITE_SPACE);
+ buf.append(vals[t]).append(ITool.WHITE_SPACE);
}
setOption(((IOption) key),
buf.toString().trim());
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java
index f055869c3ea..2f72f7e4c21 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java
@@ -645,10 +645,10 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
break;
}
- result.append(Messages.ToolChainEditTab_15 +
- (i+1) + Messages.ToolChainEditTab_16 +
- SPACE + t + SPACE + o + SPACE + n +
- Messages.ToolChainEditTab_17);
+ result.append(Messages.ToolChainEditTab_15)
+ .append(i+1).append(Messages.ToolChainEditTab_16)
+ .append(SPACE).append(t).append(SPACE).append(o).append(SPACE).append(n)
+ .append(Messages.ToolChainEditTab_17);
}
String s = result.toString();
if (s.trim().length() == 0)

Back to the top