1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

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>
This commit is contained in:
Alex Blewitt 2016-04-21 22:11:13 +01:00 committed by Gerrit Code Review @ Eclipse.org
parent 8a2fd3307b
commit ccbab86d6c
120 changed files with 300 additions and 302 deletions

View file

@ -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$

View file

@ -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$

View file

@ -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());

View file

@ -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 = "";

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2000, 2016 IBM 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
@ -135,7 +135,7 @@ public class AutoconfAnnotationHover implements IAnnotationHover, IAnnotationHov
* Formats a message as HTML text.
*/
private String formatSingleMessage(String message) {
StringBuffer buffer= new StringBuffer();
StringBuilder buffer= new StringBuilder();
HTMLPrinter.addPageProlog(buffer);
HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message));
HTMLPrinter.addPageEpilog(buffer);
@ -146,7 +146,7 @@ public class AutoconfAnnotationHover implements IAnnotationHover, IAnnotationHov
* Formats several message as HTML text.
*/
private String formatMultipleMessages(List<String> messages) {
StringBuffer buffer= new StringBuffer();
StringBuilder buffer= new StringBuilder();
HTMLPrinter.addPageProlog(buffer);
HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(AutoconfEditorMessages.getString("AutoconfAnnotationHover.multipleMarkers"))); //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2015 Red Hat, Inc.
* Copyright (c) 2006, 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,7 +37,7 @@ public class AutoconfMacroPartitionRule implements IPredicateRule {
protected static final int UNDEFINED = -1;
/** Buffer used for pattern detection */
private StringBuffer fBuffer = new StringBuffer();
private StringBuilder fBuffer = new StringBuilder();
public AutoconfMacroPartitionRule(IToken inToken) {
token = inToken;

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2015 Red Hat, Inc.
* Copyright (c) 2006, 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
@ -34,7 +34,7 @@ public class AutoconfMacroRule implements IRule {
protected static final int UNDEFINED = -1;
/** Buffer used for pattern detection */
private StringBuffer fBuffer = new StringBuffer();
private StringBuilder fBuffer = new StringBuilder();
private String fStartingSequence;

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2015 Red Hat, Inc.
* Copyright (c) 2006, 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
@ -41,7 +41,7 @@ public class AutoconfPartitioner extends FastPartitioner {
public void printPartitions(ITypedRegion[] partitions)
{
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
for (int i = 0; i < partitions.length; i++)
{

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2015 Red Hat, Inc.
* Copyright (c) 2006, 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
@ -34,7 +34,7 @@ public class InlineDataRule implements IRule {
protected static final int UNDEFINED = -1;
/** Buffer used for pattern detection */
private StringBuffer fBuffer = new StringBuffer();
private StringBuilder fBuffer = new StringBuilder();
private String fStartingSequence = "<<";
@ -45,7 +45,7 @@ public class InlineDataRule implements IRule {
// Confirm an EOL delimeter after already matching first delimeter character.
protected boolean confirmDelimeter(ICharacterScanner scanner, char[] delimeter) {
int c = scanner.read();
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append((char)c);
for (int i = 1; i < delimeter.length; ++i) {
if (c == delimeter[i]) {
@ -76,7 +76,7 @@ public class InlineDataRule implements IRule {
}
char[][] lineDelimeters = scanner.getLegalLineDelimiters();
StringBuffer endMarkerBuffer = new StringBuffer();
StringBuilder endMarkerBuffer = new StringBuilder();
if (c == '-') {
fBuffer.append((char)c);
c = scanner.read();

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2015 Red Hat, Inc.
* Copyright (c) 2007, 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
@ -42,7 +42,7 @@ public class AutoconfElement {
public String toString() {
String source = getSource();
if (source == null) {
StringBuffer kids = new StringBuffer();
StringBuilder kids = new StringBuilder();
for (AutoconfElement kid : children) {
kids.append(kid.toString());
kids.append(","); //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2015 Red Hat, Inc. and others.
* Copyright (c) 2007, 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
@ -952,7 +952,7 @@ public class AutoconfParser {
// track the exact tokens forming the start and end of an argument, defaulting
// to the borders of the parentheses and commas if no text is included.
StringBuffer argBuffer = new StringBuffer();
StringBuilder argBuffer = new StringBuilder();
AutoconfMacroArgumentElement arg = new AutoconfMacroArgumentElement();
while (true) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2012 Nokia Corporation.
* Copyright (c) 2008, 2016 Nokia Corporation.
* 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
@ -146,7 +146,7 @@ public class AutoconfTokenizer {
}
startOffset = offset;
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
// check EOL
if (ch == '\r' || ch == '\n') {
@ -251,7 +251,7 @@ public class AutoconfTokenizer {
}
private Token parseWord(char ch) {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(ch);
offset++;
@ -306,7 +306,7 @@ public class AutoconfTokenizer {
private Token parseQuote() {
// read text, honoring nested quotes, but don't put the outermost quotes in the token
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
int quoteLevel = 1;
// keep reading until the close quote
@ -338,7 +338,7 @@ public class AutoconfTokenizer {
startOffset = offset;
offset++;
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
char ch = 0;
while (offset < chars.length) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2012 IBM Corporation and others.
* Copyright (c) 2005, 2016 IBM 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
@ -94,7 +94,7 @@ public class AutotoolsUIPluginImages {
}
private static URL makeIconFileURL(String prefix, String name) {
StringBuffer buffer= new StringBuffer(prefix);
StringBuilder buffer= new StringBuilder(prefix);
buffer.append(name);
try {
return new URL(fgIconBaseURL, buffer.toString());

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000 2015 IBM Corporation and others.
* Copyright (c) 2000, 2016 IBM 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
@ -172,7 +172,7 @@ public class HTML2TextReader extends SubstitutionTextReader {
*/
private String processHTMLTag() throws IOException {
StringBuffer buf= new StringBuffer();
StringBuilder buf= new StringBuilder();
int ch;
do {
@ -241,7 +241,7 @@ public class HTML2TextReader extends SubstitutionTextReader {
* A '&' has been read. Process a entity
*/
private String processEntity() throws IOException {
StringBuffer buf= new StringBuffer();
StringBuilder buf= new StringBuilder();
int ch= nextChar();
while (Character.isLetterOrDigit((char)ch) || ch == '#') {
buf.append((char) ch);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000 2015 IBM Corporation and others.
* Copyright (c) 2000, 2016 IBM 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
@ -68,7 +68,7 @@ public class HTMLTextPresenter implements DefaultInformationControl.IInformation
}
}
private void append(StringBuffer buffer, String string, TextPresentation presentation) {
private void append(StringBuilder buffer, String string, TextPresentation presentation) {
int length= string.length();
buffer.append(string);
@ -97,7 +97,7 @@ public class HTMLTextPresenter implements DefaultInformationControl.IInformation
GC gc= new GC(display);
try {
StringBuffer buffer= new StringBuffer();
StringBuilder buffer= new StringBuilder();
int maxNumberOfLines= Math.round((float)maxHeight / gc.getFontMetrics().getHeight());
fCounter= 0;
@ -157,7 +157,7 @@ public class HTMLTextPresenter implements DefaultInformationControl.IInformation
}
}
private String trim(StringBuffer buffer, TextPresentation presentation) {
private String trim(StringBuilder buffer, TextPresentation presentation) {
int length= buffer.length();

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2012 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -111,7 +111,7 @@ public class MakeUIImages {
}
private static URL makeIconFileURL(String prefix, String name) {
StringBuffer buffer = new StringBuffer(prefix);
StringBuilder buffer = new StringBuilder(prefix);
buffer.append(name);
try {
return new URL(fgIconBaseURL, buffer.toString());

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000 2015 IBM Corporation and others.
* Copyright (c) 2000, 2016 IBM 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
@ -55,7 +55,7 @@ public abstract class SingleCharReader extends Reader {
* Gets the content as a String
*/
public String getString() throws IOException {
StringBuffer buf= new StringBuffer();
StringBuilder buf= new StringBuilder();
int ch;
while ((ch= read()) != -1) {
buf.append((char)ch);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000 2015 IBM Corporation and others.
* Copyright (c) 2000, 2016 IBM 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
@ -30,13 +30,13 @@ public abstract class SubstitutionTextReader extends SingleCharReader {
private int fCharAfterWhiteSpace;
private boolean fReadFromBuffer;
private StringBuffer fBuffer;
private StringBuilder fBuffer;
private int fIndex;
protected SubstitutionTextReader(Reader reader) {
fReader= reader;
fBuffer= new StringBuffer();
fBuffer= new StringBuilder();
fIndex= 0;
fReadFromBuffer= false;
fCharAfterWhiteSpace= -1;

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2015 Red Hat Inc..
* Copyright (c) 2009, 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
@ -128,7 +128,7 @@ public abstract class AbstractAutotoolsHandler extends AbstractHandler {
String currentWord = st.nextToken().trim();
if (currentWord.startsWith("'")) { //$NON-NLS-1$
StringBuffer tmpTarget = new StringBuffer();
StringBuilder tmpTarget = new StringBuilder();
while (!currentWord.endsWith("'")) { //$NON-NLS-1$
tmpTarget.append(currentWord + " "); //$NON-NLS-1$
if (!st.hasMoreTokens()) {
@ -144,7 +144,7 @@ public abstract class AbstractAutotoolsHandler extends AbstractHandler {
}
if (currentWord.startsWith("\"")) { //$NON-NLS-1$
StringBuffer tmpTarget = new StringBuffer();
StringBuilder tmpTarget = new StringBuilder();
while (!currentWord.endsWith("\"")) { //$NON-NLS-1$
tmpTarget.append(currentWord + " "); //$NON-NLS-1$
if (!st.hasMoreTokens()) {
@ -286,7 +286,7 @@ public abstract class AbstractAutotoolsHandler extends AbstractHandler {
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
IConfiguration cfg = info.getDefaultConfiguration();
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
String[] consoleHeader = new String[3];
consoleHeader[0] = actionName;
@ -338,7 +338,7 @@ public abstract class AbstractAutotoolsHandler extends AbstractHandler {
// some Linux shells such as dash. Using sh -c will
// work on all Linux
// POSIX-compliant shells.
StringBuffer command1 = new StringBuffer(strippedCommand);
StringBuilder command1 = new StringBuilder(strippedCommand);
for (String arg : argumentList) {
command1.append(" " + arg);
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -202,8 +202,8 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
int len = line.length();
boolean foundDollar = false;
boolean inMacro = false;
StringBuffer buffer = new StringBuffer();
StringBuffer macroName = new StringBuffer();
StringBuilder buffer = new StringBuilder();
StringBuilder macroName = new StringBuilder();
for (int i = 0; i < len; i++) {
char c = line.charAt(i);
switch(c) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -26,7 +26,7 @@ class AutomakeMacroDefinitionRule implements IPredicateRule {
private static final int ERROR_STATE = 5;
private IToken token;
private StringBuffer buffer = new StringBuffer();
private StringBuilder buffer = new StringBuilder();
protected IToken defaultToken;
public AutomakeMacroDefinitionRule(IToken token, IToken defaultToken) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2015 Red Hat Inc..
* Copyright (c) 2006, 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
@ -73,7 +73,7 @@ public class AutomakeTextHover implements ITextHover, ITextHoverExtension {
case '?':
preReqs = target.getPrerequisites();
if (preReqs != null && preReqs.length > 0) {
StringBuffer toReturn = new StringBuffer();
StringBuilder toReturn = new StringBuilder();
toReturn.append(preReqs[0]);
for (int i = 1; i < preReqs.length; i++) {
toReturn.append(" " + preReqs[i]);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -80,7 +80,7 @@ public class Command extends Directive implements ICommand {
@Override
public String toString() {
StringBuffer cmd = new StringBuffer();
StringBuilder cmd = new StringBuilder();
cmd.append( '\t');
if (getPrefix() != 0) {
cmd.append(getPrefix());

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -27,7 +27,7 @@ public class Comment extends Directive implements IComment {
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(POUND_STRING).append(comment).append('\n');
return buffer.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -39,7 +39,7 @@ public class GNUTargetRule extends TargetRule {
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(getTarget().toString());
buffer.append(':');
String[] reqs = getNormalPrerequisites();

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -59,7 +59,7 @@ public class If extends Conditional implements IAutomakeConditional, ICommand {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IF);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.CONDITIONAL_IF);
sb.append(' ').append(getVariable());
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -25,7 +25,7 @@ public class Ifdef extends Conditional {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IFDEF);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.CONDITIONAL_IFDEF);
sb.append(' ').append(getVariable());
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -24,7 +24,7 @@ public class Ifeq extends Conditional {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IFEQ);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.CONDITIONAL_IFEQ);
sb.append(' ').append(getConditional());
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -25,7 +25,7 @@ public class Ifndef extends Conditional {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IFNDEF);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.CONDITIONAL_IFNDEF);
sb.append(' ').append(getVariable());
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -24,7 +24,7 @@ public class Ifneq extends Conditional {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IFNEQ);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.CONDITIONAL_IFNEQ);
sb.append(' ').append(getConditional());
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -28,7 +28,7 @@ public class Include extends Parent implements IInclude {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.DIRECTIVE_INCLUDE);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.DIRECTIVE_INCLUDE);
for (int i = 0; i < filenames.length; i++) {
sb.append(' ').append(filenames[i]);
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -28,7 +28,7 @@ public class InferenceRule extends Rule {
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(getTarget().toString()).append(":\n"); //$NON-NLS-1$
ICommand[] cmds = getCommands();
for (int i = 0; i < cmds.length; i++) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2015 QNX Software Systems and others.
* Copyright (c) 2002, 2016 QNX Software Systems 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
@ -25,7 +25,7 @@ class MacroDefinitionRule implements IPredicateRule {
private static final int ERROR_STATE = 5;
private IToken token;
private StringBuffer buffer = new StringBuffer();
private StringBuilder buffer = new StringBuilder();
protected IToken defaultToken;
public MacroDefinitionRule(IToken token, IToken defaultToken) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -148,7 +148,7 @@ public class MakefileAnnotationHover implements IAnnotationHover, IAnnotationHov
* Formats a message as HTML text.
*/
private String formatSingleMessage(String message) {
StringBuffer buffer= new StringBuffer();
StringBuilder buffer= new StringBuilder();
HTMLPrinter.addPageProlog(buffer);
HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message));
HTMLPrinter.addPageEpilog(buffer);
@ -159,7 +159,7 @@ public class MakefileAnnotationHover implements IAnnotationHover, IAnnotationHov
* Formats several message as HTML text.
*/
private String formatMultipleMessages(List<String> messages) {
StringBuffer buffer= new StringBuffer();
StringBuilder buffer= new StringBuilder();
HTMLPrinter.addPageProlog(buffer);
HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(AutoconfEditorMessages.getString("AutoconfAnnotationHover.multipleMarkers"))); //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -31,7 +31,7 @@ public class MakefileReader extends LineNumberReader {
@Override
public String readLine() throws IOException {
boolean done = false;
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
boolean escapedLine = false;
boolean escapedCommand = false;
while (!done) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -64,7 +64,7 @@ public class MakefileTextHover implements ITextHover {
statements = new IMacroDefinition[0];
}
// iterate over all the different categories
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
for (int i = 0; i < statements.length; i++) {
if (i > 0) {
buffer.append("\n"); //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -63,7 +63,7 @@ public abstract class Parent extends Directive implements IParent {
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
IDirective[] directives = getDirectives();
for (int i = 0; i < directives.length; i++) {
sb.append(directives[i]);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -32,7 +32,7 @@ public abstract class SpecialRule extends Rule implements ISpecialRule {
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(target).append(':');
String[] reqs = getPrerequisites();
for (int i = 0; i < reqs.length; i++) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -49,7 +49,7 @@ public class StaticTargetRule extends InferenceRule implements IInferenceRule {
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(getTarget()).append(':');
String pattern = getTargetPattern();
if (pattern != null && pattern.length() > 0) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2015 IBM Corporation and others.
* Copyright (c) 2005, 2016 IBM 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
@ -112,7 +112,7 @@ public class StatusInfo implements IStatus {
*/
@Override
public String toString() {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append("StatusInfo "); //$NON-NLS-1$
if (fSeverity == OK) {
buf.append("OK"); //$NON-NLS-1$

View file

@ -248,7 +248,7 @@ public class StringMatcher {
Vector<String> temp = new Vector<>();
int pos= 0;
StringBuffer buf= new StringBuffer();
StringBuilder buf= new StringBuilder();
while (pos < fLength) {
char c= fPattern.charAt(pos++);
switch (c) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -53,7 +53,7 @@ public class TargetRule extends Rule implements ITargetRule {
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(getTarget().toString());
buffer.append(':');
String[] reqs = getPrerequisites();

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -23,7 +23,7 @@ public class UnExport extends Directive implements IUnExport {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.DIRECTIVE_UNEXPORT);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.DIRECTIVE_UNEXPORT);
sb.append(' ').append(variable);
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -25,7 +25,7 @@ public class VPath extends Directive implements IVPath {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.DIRECTIVE_VPATH);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.DIRECTIVE_VPATH);
if (pattern != null && pattern.length() > 0) {
sb.append(' ').append(pattern);
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2015 QNX Software Systems and others.
* Copyright (c) 2002, 2016 QNX Software Systems 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
@ -296,7 +296,7 @@ public abstract class AbstractEditorPreferencePage extends PreferencePage implem
protected String loadPreviewContentFromFile(String filename) {
String line;
String separator= System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
StringBuffer buffer= new StringBuffer(512);
StringBuilder buffer= new StringBuilder(512);
BufferedReader reader= null;
try {
reader= new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(filename)));

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2015 Red Hat Inc.
* Copyright (c) 2009, 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
@ -105,7 +105,7 @@ public class AutotoolsCategoryPropertyOptionPage extends
@Override
protected String createList(String[] arg0) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (String item : arg0) {
sb.append(item);
sb.append("\\s"); //$NON-NLS-1$

View file

@ -288,7 +288,7 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
}
private static String getIndexedInfoFromDocument(String name, Document document) {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
if (document != null && name != null) {
Element elem = document.getElementById(name);
@ -300,7 +300,7 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
Node n = nl.item(i);
String nodeName = n.getNodeName();
if (nodeName.equals("prototype")) { //$NON-NLS-1$
StringBuffer prototype = new StringBuffer();
StringBuilder prototype = new StringBuilder();
++prototypeCount;
if (prototypeCount == 1) {
buffer.append(" (");
@ -364,7 +364,7 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
Node n2 = macroAttrs.getNamedItem("id"); //$NON-NLS-1$
if (n2 != null) {
String name = n2.getNodeValue();
StringBuffer parms = new StringBuffer();
StringBuilder parms = new StringBuilder();
NodeList macroChildren = macro.getChildNodes();
for (int j = 0; j < macroChildren.getLength(); ++j) {
Node x = macroChildren.item(j);
@ -540,7 +540,7 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
try {
styleSheetURL= FileLocator.toFileURL(styleSheetURL);
try (BufferedReader reader= new BufferedReader(new InputStreamReader(styleSheetURL.openStream()))) {
StringBuffer buffer= new StringBuffer(200);
StringBuilder buffer= new StringBuilder(200);
String line= reader.readLine();
while (line != null) {
buffer.append(line);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2011 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -79,7 +79,7 @@ public final class InfoContext {
@Override
public String toString() {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
if(fProject != null)
buf.append(fProject.toString());

View file

@ -340,7 +340,7 @@ public class BuildInfoFactory {
@Override
public void setErrorParsers(String[] parsers) throws CoreException {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for (int i = 0; i < parsers.length; i++) {
buf.append(parsers[i]).append(';');
}
@ -377,7 +377,7 @@ public class BuildInfoFactory {
protected Map<String, String> decodeMap(String value) {
Map<String, String> map = new HashMap<>();
if (value != null) {
StringBuffer envStr = new StringBuffer(value);
StringBuilder envStr = new StringBuilder(value);
String escapeChars = "|\\"; //$NON-NLS-1$
char escapeChar = '\\';
try {
@ -397,7 +397,7 @@ public class BuildInfoFactory {
}
ndx++;
}
StringBuffer line = new StringBuffer(envStr.substring(0, ndx));
StringBuilder line = new StringBuilder(envStr.substring(0, ndx));
int lndx = 0;
while (lndx < line.length()) {
if (line.charAt(lndx) == '=') {
@ -420,7 +420,7 @@ public class BuildInfoFactory {
}
protected String encodeMap(Map<String, String> values) {
StringBuffer str = new StringBuffer();
StringBuilder str = new StringBuilder();
for (Entry<String, String> entry : values.entrySet()) {
str.append(escapeChars(entry.getKey(), "=|\\", '\\')); //$NON-NLS-1$
str.append("="); //$NON-NLS-1$
@ -431,7 +431,7 @@ public class BuildInfoFactory {
}
protected String escapeChars(String string, String escapeChars, char escapeChar) {
StringBuffer str = new StringBuffer(string);
StringBuilder str = new StringBuilder(string);
for (int i = 0; i < str.length(); i++) {
if (escapeChars.indexOf(str.charAt(i)) != -1) {
str.insert(i, escapeChar);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -30,7 +30,7 @@ public class MakeRecon extends OutputStream {
IProgressMonitor monitor;
OutputStream console;
MyList log;
StringBuffer currentLine;
StringBuilder currentLine;
class MyList extends ArrayList<String> {
private static final long serialVersionUID = 1L;
@ -68,7 +68,7 @@ public class MakeRecon extends OutputStream {
directory = workingDirectory;
monitor = mon;
console = cos;
currentLine = new StringBuffer();
currentLine = new StringBuilder();
log = new MyList();
// Get the buffer log.

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2014 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -219,8 +219,8 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
int len = line.length();
boolean foundDollar = false;
boolean inMacro = false;
StringBuffer buffer = new StringBuffer();
StringBuffer macroName = new StringBuffer();
StringBuilder buffer = new StringBuilder();
StringBuilder macroName = new StringBuilder();
for (int i = 0; i < len; i++) {
char c = line.charAt(i);
switch(c) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -80,7 +80,7 @@ public class Command extends Directive implements ICommand {
@Override
public String toString() {
StringBuffer cmd = new StringBuffer();
StringBuilder cmd = new StringBuilder();
cmd.append( '\t');
if (getPrefix() != 0) {
cmd.append(getPrefix());

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -27,7 +27,7 @@ public class Comment extends Directive implements IComment {
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(POUND_STRING).append(comment).append('\n');
return buffer.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -31,7 +31,7 @@ public class InferenceRule extends Rule {
*/
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(getTarget().toString()).append(":\n"); //$NON-NLS-1$
ICommand[] cmds = getCommands();
for (int i = 0; i < cmds.length; i++) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -31,7 +31,7 @@ public class MakefileReader extends LineNumberReader {
@Override
public String readLine() throws IOException {
boolean done = false;
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
boolean escapedLine = false;
boolean escapedCommand = false;
while (!done) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2013 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -78,7 +78,7 @@ public abstract class Parent extends Directive implements IParent {
*/
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
IDirective[] directives = getDirectives();
for (int i = 0; i < directives.length; i++) {
sb.append(directives[i]);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -32,7 +32,7 @@ public abstract class SpecialRule extends Rule implements ISpecialRule {
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(target).append(':');
String[] reqs = getPrerequisites();
for (int i = 0; i < reqs.length; i++) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -60,7 +60,7 @@ public class TargetRule extends Rule implements ITargetRule {
*/
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(getTarget().toString());
buffer.append(':');
String[] reqs = getPrerequisites();

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -67,7 +67,7 @@ public class GNUMakefileValidator implements IMakefileValidator {
if (problemMarkerInfo.file != null) {
name = problemMarkerInfo.file.getName();
}
StringBuffer sb = new StringBuffer(name);
StringBuilder sb = new StringBuilder(name);
sb.append(':').append(problemMarkerInfo.lineNumber).append(':').append(getSeverity(problemMarkerInfo.severity));
if (problemMarkerInfo.description != null) {
sb.append(':').append(problemMarkerInfo.description);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -47,7 +47,7 @@ public class GNUTargetRule extends TargetRule {
*/
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(getTarget().toString());
buffer.append(':');
String[] reqs = getNormalPrerequisites();

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -27,7 +27,7 @@ public class Ifdef extends Conditional {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IFDEF);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.CONDITIONAL_IFDEF);
sb.append(' ').append(getVariable());
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -26,7 +26,7 @@ public class Ifeq extends Conditional {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IFEQ);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.CONDITIONAL_IFEQ);
sb.append(' ').append(getConditional());
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -27,7 +27,7 @@ public class Ifndef extends Conditional {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IFNDEF);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.CONDITIONAL_IFNDEF);
sb.append(' ').append(getVariable());
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -26,7 +26,7 @@ public class Ifneq extends Conditional {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IFNEQ);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.CONDITIONAL_IFNEQ);
sb.append(' ').append(getConditional());
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2013 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -37,7 +37,7 @@ public class Include extends Parent implements IInclude {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.DIRECTIVE_INCLUDE);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.DIRECTIVE_INCLUDE);
for (int i = 0; i < filenames.length; i++) {
sb.append(' ').append(filenames[i]);
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -57,7 +57,7 @@ public class StaticTargetRule extends InferenceRule implements IInferenceRule {
*/
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(getTarget()).append(':');
String pattern = getTargetPattern();
if (pattern != null && pattern.length() > 0) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -24,7 +24,7 @@ public class UnExport extends Directive implements IUnExport {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.DIRECTIVE_UNEXPORT);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.DIRECTIVE_UNEXPORT);
sb.append(' ').append(variable);
return sb.toString();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -26,7 +26,7 @@ public class VPath extends Directive implements IVPath {
@Override
public String toString() {
StringBuffer sb = new StringBuffer(GNUMakefileConstants.DIRECTIVE_VPATH);
StringBuilder sb = new StringBuilder(GNUMakefileConstants.DIRECTIVE_VPATH);
if (pattern != null && pattern.length() > 0) {
sb.append(' ').append(pattern);
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2011 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -348,7 +348,7 @@ public class CDataDiscoveredInfoCalculator {
if(fExts.length == 0)
return "<empty>"; //$NON-NLS-1$
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for(int i = 0; i < fExts.length; i++){
if(i != 0)

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2012 IBM Corporation and others.
* Copyright (c) 2004, 2016 IBM 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
@ -186,7 +186,7 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
protected String[][] tokenize(String line, boolean escapeInsideDoubleQuotes) {
ArrayList<String[]> commands= new ArrayList<String[]>();
ArrayList<String> tokens= new ArrayList<String>();
StringBuffer token= new StringBuffer();
StringBuilder token= new StringBuilder();
final char[] input= line.toCharArray();
boolean nextEscaped= false;
@ -283,14 +283,14 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
return commands.toArray(new String[commands.size()][]);
}
private void endCommand(StringBuffer token, ArrayList<String> tokens, ArrayList<String[]> commands) {
private void endCommand(StringBuilder token, ArrayList<String> tokens, ArrayList<String[]> commands) {
endToken(token, tokens);
if (!tokens.isEmpty()) {
commands.add(tokens.toArray(new String[tokens.size()]));
tokens.clear();
}
}
private void endToken(StringBuffer token, ArrayList<String> tokens) {
private void endToken(StringBuilder token, ArrayList<String> tokens) {
if (token.length() > 0) {
tokens.add(token.toString());
token.setLength(0);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2011 IBM Corporation and others.
* Copyright (c) 2004, 2016 IBM 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
@ -103,7 +103,7 @@ public abstract class AbstractGCCBOPConsoleParserUtility {
public static IPath convertCygpath(IPath path) {
if (path.segmentCount() > 1 && path.segment(0).equals("cygdrive")) { //$NON-NLS-1$
StringBuffer buf = new StringBuffer(2);
StringBuilder buf = new StringBuilder(2);
buf.append(Character.toUpperCase(path.segment(1).charAt(0)));
buf.append(':');
path = path.removeFirstSegments(2);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2013 IBM Corporation and others.
* Copyright (c) 2004, 2016 IBM 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
@ -267,7 +267,7 @@ public class ScannerInfoConsoleParserUtility extends AbstractGCCBOPConsoleParser
if (column > 0) {
char driveLetter = path.charAt(column - 1);
if (Character.isLowerCase(driveLetter)) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if (column - 1 > 0) {
sb.append(path.substring(0, column-1));
}
@ -280,9 +280,9 @@ public class ScannerInfoConsoleParserUtility extends AbstractGCCBOPConsoleParser
return (new Path(path)).toString(); // convert separators to '/'
}
// lose "./" segments since they confuse the Path normalization
StringBuffer buf = new StringBuffer(path);
StringBuilder buf = new StringBuilder(path);
int len = buf.length();
StringBuffer newBuf = new StringBuffer(buf.length());
StringBuilder newBuf = new StringBuilder(buf.length());
int scp = 0; // starting copy point
int ssp = 0; // starting search point
int sdot;

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2010 IBM Corporation and others.
* Copyright (c) 2004, 2016 IBM 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
@ -70,7 +70,7 @@ public class SCDMakefileGenerator extends DefaultRunSIProvider {
resource.getProject(), ScannerInfoTypes.UNDISCOVERED_COMPILER_COMMAND);
if (commands != null && commands.size() > 0) {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append("# This is a generated file. Please do not edit."); //$NON-NLS-1$
buffer.append(DENDL);
buffer.append(".PHONY: all"); //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2013 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -51,8 +51,8 @@ public class AddBuildTargetAction extends Action {
Shell shell = fOutliner.getControl().getShell();
ITargetRule[] rules = getTargetRules(fOutliner.getSelection());
if (file != null && rules.length > 0 && shell != null) {
StringBuffer sbBuildName = new StringBuffer();
StringBuffer sbMakefileTarget = new StringBuffer();
StringBuilder sbBuildName = new StringBuilder();
StringBuilder sbMakefileTarget = new StringBuilder();
for (ITargetRule rule : rules) {
String name = rule.getTarget().toString().trim();
if (sbBuildName.length() == 0) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2015 QNX Software Systems and others.
* Copyright (c) 2002, 2016 QNX Software Systems 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
@ -307,7 +307,7 @@ public abstract class AbstractMakefileEditorPreferencePage extends PreferencePag
protected String loadPreviewContentFromFile(String filename) {
String line;
String separator= System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
StringBuffer buffer= new StringBuffer(512);
StringBuilder buffer= new StringBuilder(512);
BufferedReader reader= null;
try {
reader= new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(filename)));

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013, 2015 Andrew Gvozdev and others.
* Copyright (c) 2013, 2016 Andrew Gvozdev 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
@ -19,7 +19,7 @@ import org.eclipse.jface.text.rules.WordRule;
public class FunctionReferenceRule extends WordRule {
/** Buffer used for pattern detection. */
private StringBuffer fBuffer= new StringBuffer();
private StringBuilder fBuffer= new StringBuilder();
private String startSeq;
private String endSeq;

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2009 QNX Software Systems and others.
* Copyright (c) 2002, 2016 QNX Software Systems 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
@ -24,7 +24,7 @@ class MacroDefinitionRule implements IPredicateRule {
private static final int ERROR_STATE = 5;
private IToken token;
private StringBuffer buffer = new StringBuffer();
private StringBuilder buffer = new StringBuilder();
protected IToken defaultToken;
public MacroDefinitionRule(IToken token, IToken defaultToken) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2013 QNX Software Systems and others.
* Copyright (c) 2000, 2016 QNX Software Systems 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
@ -70,7 +70,7 @@ public class MakefileTextHover implements ITextHover {
statements = new IMacroDefinition[0];
}
// iterate over all the different categories
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
for (int i = 0; i < statements.length; i++) {
if (i > 0) {
buffer.append("\n"); //$NON-NLS-1$

View file

@ -287,7 +287,7 @@ public class MakeTargetDialog extends Dialog {
@Override
public void widgetSelected(SelectionEvent e) {
if (useBuilderCommandCheckBox.getSelection() == true) {
StringBuffer cmd = new StringBuffer(builderCommand.toString());
StringBuilder cmd = new StringBuilder(builderCommand.toString());
if (builderArguments != null && !builderArguments.isEmpty()) {
cmd.append(" "); //$NON-NLS-1$
cmd.append(builderArguments);
@ -398,7 +398,7 @@ public class MakeTargetDialog extends Dialog {
}
targetNameText.selectAll();
if (targetBuildCommand != null) {
StringBuffer cmd = new StringBuffer(targetBuildCommand.toOSString());
StringBuilder cmd = new StringBuilder(targetBuildCommand.toOSString());
if (targetBuildArguments != null && !targetBuildArguments.isEmpty()) {
cmd.append(" "); //$NON-NLS-1$
cmd.append(targetBuildArguments);
@ -433,7 +433,7 @@ public class MakeTargetDialog extends Dialog {
return true;
}
if (!isUsingBuilderCommand) {
StringBuffer cmd = new StringBuffer(targetBuildCommand.toOSString()).append(targetBuildArguments);
StringBuilder cmd = new StringBuilder(targetBuildCommand.toOSString()).append(targetBuildArguments);
if (!getBuildLine().equals(cmd.toString())) {
return true;
}

View file

@ -175,7 +175,7 @@ public class SettingsBlock extends AbstractCOptionPage {
}
});
if (fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, null) != null) {
StringBuffer cmd = new StringBuffer(fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, "")); //$NON-NLS-1$
StringBuilder cmd = new StringBuilder(fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, "")); //$NON-NLS-1$
if (!fBuildInfo.isDefaultBuildCmd()) {
String args = fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, ""); //$NON-NLS-1$
if (args != null && !args.isEmpty()) {
@ -542,7 +542,7 @@ public class SettingsBlock extends AbstractCOptionPage {
else
stopOnErrorButton.setSelection(false);
if (info.getBuildCommand() != null) {
StringBuffer cmd = new StringBuffer(info.getBuildCommand().toOSString());
StringBuilder cmd = new StringBuilder(info.getBuildCommand().toOSString());
if (!info.isDefaultBuildCmd()) {
String args = info.getBuildArguments();
if (args != null && !args.isEmpty()) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2012 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -146,7 +146,7 @@ public class BuildSystemTestHelper {
}
static public String arrayToString(Object[] arr){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append('[');
for(int i = 0; i < arr.length; i++) {
if(i != 0)

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2011 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -30,7 +30,7 @@ public class DiffUtil {
}
private static String createCommand(String location1, String location2){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(DIFF_CMD).append(" '").append(location1).append("' '").append(location2).append("'");
return buf.toString();
}
@ -43,7 +43,7 @@ public class DiffUtil {
BufferedReader br;
br = new BufferedReader(new InputStreamReader(in));
String line;
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
try {
while ((line = br.readLine()) != null) {
buf.append("\n");

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
* Copyright (c) 2000, 2016 IBM 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
@ -94,7 +94,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
@Override
public String toString() {
StringBuffer buf = new StringBuffer("ExpectedChange(");
StringBuilder buf = new StringBuilder("ExpectedChange(");
buf.append(fResource);
buf.append(", ");
buf.append(convertKind(fKind));
@ -111,7 +111,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
*/
private Hashtable<IPath, ExpectedChange> fExpectedChanges = new Hashtable<IPath, ExpectedChange>();
boolean fIsDeltaValid = true;
private StringBuffer fMessage = new StringBuffer();
private StringBuilder fMessage = new StringBuilder();
/**
* The verifier can be in one of three states. In the initial
* state, the verifier is still receiving inputs via the
@ -370,7 +370,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
if (changeFlags == 0) {
return "0";
}
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
if ((changeFlags & IResourceDelta.CONTENT) != 0) {
changeFlags ^= IResourceDelta.CONTENT;

View file

@ -83,7 +83,7 @@ public class Test30_2_CommandLineGenerator implements
// Generate the command line
int start = 0;
int stop = 0;
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
while( (start = commandLinePattern.indexOf( VAR_FIRST_CHAR, start )) >= 0 ) {
if( commandLinePattern.charAt( start + 1 ) != VAR_SECOND_CHAR ) {
sb.append(VAR_FIRST_CHAR);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2011 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -245,7 +245,7 @@ public class ToolChainModificationTests extends TestCase {
s1.removeAll(s2);
s2.removeAll(s1c);
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append("checking c1..\n");
boolean fail = checkEmpty(s1, buf);
buf.append("checking c2..\n");
@ -255,7 +255,7 @@ public class ToolChainModificationTests extends TestCase {
fail(buf.toString());
}
private boolean checkEmpty(Collection<? extends IBuildObject> c, StringBuffer buf){
private boolean checkEmpty(Collection<? extends IBuildObject> c, StringBuilder buf){
if(c.size() != 0){
buf.append("non-empty dump:\n");
for (IBuildObject bo : c)

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2011 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -75,7 +75,7 @@ public final class CfgInfoContext{
public InfoContext toInfoContext(){
if(fContext == null){
IProject project = fCfg.isPreference() ? null : fCfg.getOwner().getProject();
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(fCfg.getId());
if(fRcInfo != null){
buf.append(DELIMITER);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2011 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -347,7 +347,7 @@ public class PerFileSettingsCalculator {
if(fExts.length == 0)
return "<empty>"; //$NON-NLS-1$
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for(int i = 0; i < fExts.length; i++){
if(i != 0)

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2010 Intel Corporation and others.
* Copyright (c) 2006, 2016 Intel 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
@ -293,7 +293,7 @@ public class BuildDescriptionManager {
// IPath path = null;
IPath tmp = cwd;
StringBuffer buf = null;
StringBuilder buf = null;
while(tmp.segmentCount() != 0){
if(tmp.isPrefixOf(location)){
IPath p = location.removeFirstSegments(tmp.segmentCount()).setDevice(null);
@ -303,7 +303,7 @@ public class BuildDescriptionManager {
return new Path(buf.toString());
}
if(buf == null){
buf = new StringBuffer();
buf = new StringBuilder();
buf.append("../"); //$NON-NLS-1$
} else {
buf.append("../"); //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2010, 2012 Wind River Systems and others.
* Copyright (c) 2010, 2016 Wind River Systems 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
@ -225,7 +225,7 @@ public class ExternalBuildRunner extends AbstractBuildRunner {
// Convert into env strings
List<String> strings= new ArrayList<String>(env.size());
for (Entry<String, String> entry : env.entrySet()) {
StringBuffer buffer= new StringBuffer(entry.getKey());
StringBuilder buffer= new StringBuilder(entry.getKey());
buffer.append('=').append(entry.getValue());
strings.add(buffer.toString());
}

View file

@ -3714,7 +3714,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
if(prefix.segmentCount() > 0){
int diff = container.segmentCount() - prefix.segmentCount();
StringBuffer buff = new StringBuffer();
StringBuilder buff = new StringBuilder();
while(diff-- > 0)
buff.append("../"); //$NON-NLS-1$
path = new Path(buff.toString()).append(contents.removeFirstSegments(prefix.segmentCount()));
@ -3931,7 +3931,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
public static String fullPathToLocation(String path){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
return buf.append("${").append("workspace_loc:").append(path).append("}").toString(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2011 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -185,6 +185,6 @@ public final class OptionStringValue {
@Override
public String toString() {
return new StringBuffer().append("ov:").append(value.toString()).toString(); //$NON-NLS-1$
return new StringBuilder().append("ov:").append(value.toString()).toString(); //$NON-NLS-1$
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2011 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -122,7 +122,7 @@ public class BuildDescriptionGnuMakefileGenerator {
}
protected String createVarRef(String var){
return new StringBuffer().append(VARREF_PREFIX).append(var).append(VARREF_SUFFIX).toString();
return new StringBuilder().append(VARREF_PREFIX).append(var).append(VARREF_SUFFIX).toString();
}
protected void write(Writer writer, IBuildStep step) throws CoreException, IOException {
@ -162,7 +162,7 @@ public class BuildDescriptionGnuMakefileGenerator {
}
protected String toString(IBuildCommand cmd){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(cmd.getCommand());
String argsString = CDataUtil.arrayToString(cmd.getArgs(), SPACE);
if(argsString != null && argsString.length() != 0){
@ -181,7 +181,7 @@ public class BuildDescriptionGnuMakefileGenerator {
}
protected String toString(IBuildResource[] rcs){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for(int i = 0; i < rcs.length; i++){
if(i != 0)
buf.append(SPACE);
@ -208,7 +208,7 @@ public class BuildDescriptionGnuMakefileGenerator {
private String removeDotDotSlashes(String str){
int index = str.indexOf(DOT_DOT_SLASH, 0);
if(index != -1){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
int start = 0;
for(; index != -1; index = str.indexOf(DOT_DOT_SLASH, start)){
buf.append(str.substring(start, index));
@ -223,7 +223,7 @@ public class BuildDescriptionGnuMakefileGenerator {
private String removeDotDotBackslashes(String str){
int index = str.indexOf(DOT_DOT_BACKSLASH, 0);
if(index != -1){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
int start = 0;
for(; index != -1; index = str.indexOf(DOT_DOT_BACKSLASH, start)){
buf.append(str.substring(start, index));

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2015 Intel Corporation and others.
* Copyright (c) 2006, 2016 Intel 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
@ -237,7 +237,7 @@ public class BuildResource implements IBuildResource {
@Override
public String toString() {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append("BR "); //$NON-NLS-1$
IPath fullPath = getFullPath();
if(fullPath != null)

View file

@ -262,7 +262,7 @@ public class BuildStep implements IBuildStep {
IBuildResource[] generated = fBuildDescription.getResources(true);
if(generated.length != 0){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for(int i = 0; i < generated.length; i++){
buf.append(' ');
@ -383,7 +383,7 @@ public class BuildStep implements IBuildStep {
char prev = 0;
// int start = 0;
List<String> list = new ArrayList<String>();
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for(int i = 0; i < arr.length; i++){
char ch = arr[i];
switch(ch){
@ -523,7 +523,7 @@ public class BuildStep implements IBuildStep {
if(list == null || list.length == 0)
return ""; // $NON-NLS-1$
StringBuffer buf = new StringBuffer(list[0]);
StringBuilder buf = new StringBuilder(list[0]);
for(int i = 1; i < list.length; i++){
buf.append(delimiter).append(list[i]);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2012 Intel Corporation and others.
* Copyright (c) 2006, 2016 Intel 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
@ -181,7 +181,7 @@ public class CommandBuilder implements IBuildModelBuilder {
}
protected String getCommandLine() {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
if (fCmd != null) {
buf.append(fCmd.getCommand().toOSString());
String args[] = fCmd.getArgs();

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2010 Intel Corporation and others.
* Copyright (c) 2006, 2016 Intel 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
@ -55,7 +55,7 @@ public class DbgUtil {
}
public static String dumpType(IBuildIOType type){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append("dumping type: "); //$NON-NLS-1$
buf.append(type.isInput() ? "INPUT" : "OUTPUT"); //$NON-NLS-1$ //$NON-NLS-2$
@ -66,7 +66,7 @@ public class DbgUtil {
}
public static String ioTypeResources(IBuildIOType type){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
IBuildResource rcs[] = type.getResources();
@ -81,7 +81,7 @@ public class DbgUtil {
}
public static String dumpStep(IBuildStep step, boolean inputs) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append("dumping step ").append(stepName(step)).append(inputs ? " inputs" : " outputs"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@ -107,7 +107,7 @@ public class DbgUtil {
}
public static String dumpResource(IBuildResource rc, boolean producer){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append("dumping resource ").append(resourceName(rc)).append(producer ? " producer:" : " deps:"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006 Intel Corporation and others.
* Copyright (c) 2006, 2016 Intel 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
@ -54,7 +54,7 @@ public class ProcessLauncher {
* Returns command line in a single string
*/
public String getCommandLine() {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
if (cmd != null) {
for (int i = 0; i < cmd.length; i++) {
buf.append(cmd[i]);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2011 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -107,7 +107,7 @@ public class BuildProperties implements IBuildProperties {
if(fInexistentProperties != null){
String inexistentProps = CDataUtil.arrayToString(fInexistentProperties.toArray(new String[fInexistentProperties.size()]), BuildPropertyManager.PROPERTIES_SEPARATOR);
if(props.length() != 0){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(props).append(BuildPropertyManager.PROPERTIES_SEPARATOR).append(inexistentProps);
} else {
props = inexistentProps;
@ -123,7 +123,7 @@ public class BuildProperties implements IBuildProperties {
else if(size == 1)
return fPropertiesMap.values().iterator().next().toString();
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
Iterator<IBuildProperty> iter = fPropertiesMap.values().iterator();
buf.append(iter.next().toString());
for(;iter.hasNext();){

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2011 Intel Corporation and others.
* Copyright (c) 2007, 2016 Intel 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
@ -80,7 +80,7 @@ public class BuildProperty implements IBuildProperty{
}
public static String toString(String type, String value){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(type).append(BuildPropertyManager.PROPERTY_VALUE_SEPARATOR).append(value);
return buf.toString();

View file

@ -2491,7 +2491,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
String name = getName();
String version = ManagedBuildManager.getVersionFromIdAndVersion(getId());
if(version != null && version.length() != 0){
return new StringBuffer().append(name).append(" (").append(version).append("").toString(); //$NON-NLS-1$ //$NON-NLS-2$
return new StringBuilder().append(name).append(" (").append(version).append("").toString(); //$NON-NLS-1$ //$NON-NLS-2$
}
return name;
}
@ -2700,7 +2700,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
} else if(ids.length == 0){
errorParserIds = EMPTY_STRING;
} else {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(ids[0]);
for(int i = 1; i < ids.length; i++){
buf.append(";").append(ids[i]); //$NON-NLS-1$
@ -2730,7 +2730,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
} else {
String version = ManagedBuildManager.getVersionFromIdAndVersion(getId());
if(version != null){
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(name);
buf.append(" (v").append(version).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
name = buf.toString();

Some files were not shown because too many files have changed in this diff Show more