From 809598db9dcc078cc4d7cffd4da3d0fc0b0716a3 Mon Sep 17 00:00:00 2001 From: Alex Blewitt Date: Mon, 18 Apr 2016 09:07:43 +0100 Subject: [PATCH] Bug 491945 - Remove new String() Occurrences of `new String()` have been replaced with the equivalent `""` and additional NON-NLS tags have been inserted in where appropriate. Change-Id: I54cf71dcd0d5a92a675a71166d66949533de502b Signed-off-by: Alex Blewitt --- .../cdt/make/core/MakeScannerInfo.java | 6 ++-- .../internal/core/makefile/NullMakefile.java | 4 +-- .../core/makefile/gnu/GNUMakefile.java | 4 +-- .../core/scannerconfig/util/CCommandDSC.java | 6 ++-- .../testplugin/ManagedBuildTestHelper.java | 4 +-- .../ManagedBuildCommandLineGenerator.java | 6 ++-- .../core/tests/ManagedProjectUpdateTests.java | 4 +-- .../core/tests/ResourceBuildCoreTests.java | 4 +-- .../tests/Test30_2_CommandLineGenerator.java | 6 ++-- .../core/ManagedBuildManager.java | 2 +- .../core/ManagedBuilderCorePlugin.java | 4 +-- .../internal/buildmodel/BuildDescription.java | 4 +-- .../internal/buildmodel/BuildStep.java | 4 +-- .../internal/core/AdditionalInput.java | 4 +-- .../internal/core/CommonBuilder.java | 12 ++++---- .../internal/core/FolderInfo.java | 4 +-- .../core/GeneratedMakefileBuilder.java | 4 +-- .../internal/core/ManagedBuildInfo.java | 24 ++++++++-------- .../core/ManagedCommandLineGenerator.java | 4 +-- .../internal/core/OptionCategory.java | 4 +-- .../internal/core/OptionReference.java | 8 +++--- .../internal/core/ResourceChangeHandler.java | 4 +-- .../internal/core/ResourceConfiguration.java | 4 +-- .../managedbuilder/internal/core/Target.java | 2 +- .../internal/core/ToolReference.java | 26 ++++++++--------- .../enablement/CheckStringExpression.java | 6 ++-- .../DefaultGnuWinScannerInfoCollector.java | 4 +-- .../gnu/DefaultGCCDependencyCalculator.java | 6 ++-- ...faultGCCDependencyCalculator3Commands.java | 4 +-- .../makegen/gnu/GnuMakefileGenerator.java | 28 +++++++++---------- .../cdt/newmake/core/MakeScannerInfo.java | 6 ++-- .../BuildOptionComboFieldEditor.java | 6 ++-- .../ui/properties/BuildStepsTab.java | 6 ++-- .../NewBuildConfigurationDialog.java | 12 ++++---- .../ui/properties/NewCfgDialog.java | 6 ++-- .../ui/properties/NewVarDialog.java | 4 +-- .../model/util/AbstractEntryStorage.java | 4 +-- .../internal/core/model/BinaryFunction.java | 6 ++-- .../utils/org/eclipse/cdt/utils/coff/PE.java | 4 +-- .../eclipse/cdt/utils/debug/dwarf/Dwarf.java | 8 +++--- .../eclipse/cdt/utils/debug/stabs/Stabs.java | 4 +-- .../cdt/utils/debug/stabs/StabsReader.java | 4 +-- .../cdt/utils/debug/stabs/StringField.java | 4 +-- .../ui/tests/chelp/CHelpProviderTester.java | 4 +-- .../cdt/internal/ui/editor/IndentUtil.java | 4 +-- .../CFileTypesPreferenceBlock.java | 4 +-- .../cdt/internal/ui/search/CSearchUtil.java | 4 +-- .../cdt/ui/newui/NewConfigurationDialog.java | 12 ++++---- .../ui/newui/RenameConfigurationDialog.java | 4 +-- .../uitree/uiwidgets/UIStringListWidget.java | 4 +-- .../uitree/uiwidgets/UITextWidget.java | 4 +-- .../service/command/commands/MICommand.java | 4 +-- .../command/commands/MIDataDisassemble.java | 4 +-- .../eclipse/cdt/dsf/ui/viewmodel/VMDelta.java | 4 +-- .../cdt/launch/ui/CEnvironmentTab.java | 6 ++-- 55 files changed, 168 insertions(+), 170 deletions(-) diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java index 048c3902eda..a1c63bccd0e 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java @@ -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 @@ -92,8 +92,8 @@ public class MakeScannerInfo implements IScannerInfo { if (symbol.length() == 0) { continue; } - String key = new String(); - String value = new String(); + String key = ""; // $NON-NLS-1$ + String value = ""; // $NON-NLS-1$ int index = symbol.indexOf("="); //$NON-NLS-1$ if (index != -1) { key = symbol.substring(0, index).trim(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java index 0091d312715..caa586b4f0b 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java @@ -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 @@ -62,7 +62,7 @@ public class NullMakefile extends AbstractMakefile { @Override public String toString() { - return new String(); + return ""; // $NON-NLS-1$ } @Override diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java index 2920eada634..fba86ce8861 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java @@ -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 @@ -625,7 +625,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile { } directories = dirs.toArray(new String[0]); if (pattern == null) { - pattern = new String(); + pattern = ""; // $NON-NLS-1$ } return new VPath(this, pattern, directories); } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java index c45d508b7d1..0e8d9cbbf41 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java @@ -108,7 +108,7 @@ public class CCommandDSC { @Override public String toString() { - String commandAsString = new String(); + String commandAsString = ""; // $NON-NLS-1$ for (Iterator i = compilerCommand.iterator(); i.hasNext(); ) { KVStringPair optionPair = i.next(); String value = optionPair.getValue(); @@ -128,7 +128,7 @@ public class CCommandDSC { * @return the command line to run the scanner discovery. */ public String getSCDRunnableCommand(boolean quoteIncludePaths, boolean quoteDefines) { - String commandAsString = new String(); + String commandAsString = ""; // $NON-NLS-1$ for (Iterator i = compilerCommand.iterator(); i.hasNext(); ) { KVStringPair optionPair = i.next(); if (optionPair.getKey().equals(SCDOptionsEnum.COMMAND.toString())) { @@ -167,7 +167,7 @@ public class CCommandDSC { * @return the compiler command */ public String getCompilerName() { - String compiler = new String(); + String compiler = ""; // $NON-NLS-1$ for (Iterator i = compilerCommand.iterator(); i.hasNext(); ) { KVStringPair optionPair = i.next(); if (optionPair.getKey().equals(SCDOptionsEnum.COMMAND.toString())) { 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 9f00dbcfe0f..3e8db26e6be 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2013 Intel Corporation and others. + * Copyright (c) 2004, 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 @@ -1071,7 +1071,7 @@ public class ManagedBuildTestHelper { rcbsTool = rcConfig.createTool(null,rcbsToolId + "." + ManagedBuildManager.getRandomNumber(),rcbsToolName,false); //$NON-NLS-1$ rcbsTool.setCustomBuildStep(true); IInputType rcbsToolInputType = rcbsTool.createInputType(null,rcbsToolInputTypeId + "." + ManagedBuildManager.getRandomNumber(),rcbsToolInputTypeName,false); //$NON-NLS-1$ - IAdditionalInput rcbsToolInputTypeAdditionalInput = rcbsToolInputType.createAdditionalInput(new String()); + IAdditionalInput rcbsToolInputTypeAdditionalInput = rcbsToolInputType.createAdditionalInput(""); // $NON-NLS-1$ rcbsToolInputTypeAdditionalInput.setKind(IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY); rcbsTool.createOutputType(null,rcbsToolOutputTypeId + "." + ManagedBuildManager.getRandomNumber(),rcbsToolOutputTypeName,false); //$NON-NLS-1$ } diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCommandLineGenerator.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCommandLineGenerator.java index 851b1932929..79699bd3fc3 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCommandLineGenerator.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCommandLineGenerator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 Intel Corporation and others. + * Copyright (c) 2004, 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 @@ -33,7 +33,7 @@ public class ManagedBuildCommandLineGenerator implements // Concatenate the tool name and the passed in command name info.commandName = new String(tool.getName() + commandName); // Put out the flags backwards - String myflags = new String(); + String myflags = ""; // $NON-NLS-1$ for (int i = flags.length - 1; i >= 0; i--) { if (i < flags.length - 1) myflags += " "; myflags += flags[i]; @@ -41,7 +41,7 @@ public class ManagedBuildCommandLineGenerator implements info.commandFlags = myflags; // Alphabetize the inputs and add foo.cpp String[] inputs = new String[inputResources.length + 1]; - String myinputs = new String(); + String myinputs = ""; // $NON-NLS-1$ for (int i=0; i 0) info.commandInputs += " "; info.commandInputs += inputResources[i]; } - info.commandFlags = new String(); + info.commandFlags = ""; // $NON-NLS-1$ IOption opt = tool.getOptionBySuperClassId("test30_2.tar-list.filename"); String optVal = ""; try { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java index bde360efd74..97f9b697e64 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java @@ -1914,7 +1914,7 @@ public class ManagedBuildManager extends AbstractCExtension { // throw new CoreException(new Status(IStatus.ERROR, // ManagedBuilderCorePlugin.PLUGIN_ID, // IStatus.ERROR, -// new String(), +// "", // $NON-NLS-1$ // null)); // } // diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java index ef9aaed8521..4d027bbbfc5 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -131,7 +131,7 @@ public class ManagedBuilderCorePlugin extends Plugin { // IStatus.OK, // ManagedBuilderCorePlugin.getUniqueIdentifier(), // IStatus.OK, -// new String(), +// "", // $NON-NLS-1$ // null); // } // }; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java index 45c45fddb0b..eea92b83e52 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java @@ -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 @@ -2242,7 +2242,7 @@ public class BuildDescription implements IBuildDescription { if(!type.isInput()){ String var = type.getLinkId(); if(var == null) - var = new String(); + var = ""; // $NON-NLS-1$ Set set = fVarToAddlInSetMap.get(var); if(set != null){ diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java index 2fc5ceab4d3..023bf85e98b 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java @@ -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 @@ -521,7 +521,7 @@ public class BuildStep implements IBuildStep { private String listToString(String[] list, String delimiter){ if(list == null || list.length == 0) - return new String(); + return ""; // $NON-NLS-1$ StringBuffer buf = new StringBuffer(list[0]); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java index 657fea9bd38..5fa13748435 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java @@ -51,8 +51,6 @@ import org.eclipse.core.runtime.Path; public class AdditionalInput implements IAdditionalInput { - private static final String EMPTY_STRING = new String(); - private static final String BUILD_VARIABLE_STATIC_LIB = "ARCHIVES"; //$NON-NLS-1$ private static final String BUILD_VARIABLE_SHARED_LIB = "LIBRARIES"; //$NON-NLS-1$ @@ -220,7 +218,7 @@ public class AdditionalInput implements IAdditionalInput { str = ADDITIONAL_INPUT_DEPENDENCY; break; default: - str = EMPTY_STRING; + str = ""; // $NON-NLS-1$ break; } element.setAttribute(IAdditionalInput.KIND, str); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java index 533334735e6..4c0637b0703 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java @@ -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 @@ -621,7 +621,7 @@ public class CommonBuilder extends ACBuilder { status = new MultiStatus( ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.ERROR, - new String(), + "", // $NON-NLS-1$ null); } @@ -638,7 +638,7 @@ public class CommonBuilder extends ACBuilder { status = new MultiStatus( ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.ERROR, - new String(), + "", // $NON-NLS-1$ null); } @@ -657,7 +657,7 @@ public class CommonBuilder extends ACBuilder { status = new MultiStatus( ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, - new String(), + "", // $NON-NLS-1$ null); } @@ -814,7 +814,7 @@ public class CommonBuilder extends ACBuilder { if (buildType == FULL_BUILD || buildType == INCREMENTAL_BUILD) { consoleHeader[0] = ManagedMakeMessages.getResourceString("ManagedMakeBuider.type.incremental"); //$NON-NLS-1$ } else { - consoleHeader[0] = new String(); + consoleHeader[0] = ""; // $NON-NLS-1$ outputError(projName, "The given build type is not supported in this context"); //$NON-NLS-1$ } consoleHeader[1] = configName; @@ -1015,7 +1015,7 @@ public class CommonBuilder extends ACBuilder { // return new MultiStatus( // ManagedBuilderCorePlugin.getUniqueIdentifier(), // severity, -// new String(), +// "", // $NON-NLS-1$ // null); // } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java index 2b0d23fecf8..7f74755c62d 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 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 @@ -86,7 +86,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo { toolChain.setUnusedChildren(parTc.getUnusedChildren()); ITool tools[] = parTc.getTools(); - String subId = new String(); + String subId = ""; // $NON-NLS-1$ for (ITool tool : tools) { ITool extTool = ManagedBuildManager.getExtensionTool(tool); if(extTool == null) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java index ccc9d4f1a8f..e048bfe97cf 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2015 IBM Corporation and others. + * Copyright (c) 2002, 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 @@ -369,7 +369,7 @@ public class GeneratedMakefileBuilder extends ACBuilder { if (buildType == FULL_BUILD || buildType == INCREMENTAL_BUILD) { consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_INC); } else { - consoleHeader[0] = new String(); + consoleHeader[0] = ""; // $NON-NLS-1$ outputError(getProject().getName(), "The given build type is not supported in this context"); //$NON-NLS-1$ } consoleHeader[1] = configName; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java index 33727547c50..1b05a7157c4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2011 IBM Software Corporation and others. + * Copyright (c) 2002, 2016 IBM Software 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 @@ -157,7 +157,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { */ @Override public String getBuildArtifactExtension() { - String ext = new String(); + String ext = ""; // $NON-NLS-1$ IConfiguration config = getDefaultConfiguration(); if (config != null) { ext = config.getArtifactExtension(); @@ -171,7 +171,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Override public String getBuildArtifactName() { // Get the default configuration and use its value - String name = new String(); + String name = ""; // $NON-NLS-1$ IConfiguration config = getDefaultConfiguration(); if (config != null) { name = config.getArtifactName(); @@ -185,7 +185,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Override public String getCleanCommand() { // Get from the model - String command = new String(); + String command = ""; // $NON-NLS-1$ IConfiguration config = getDefaultConfiguration(); if (config != null) { command = config.getCleanCommand(); @@ -200,7 +200,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { public String getConfigurationName() { // Return the human-readable name of the default configuration IConfiguration config = getDefaultConfiguration(); - return config == null ? new String() : config.getName(); + return config == null ? "" : config.getName(); // $NON-NLS-1$ } /* (non-Javadoc) @@ -361,7 +361,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Override public String getToolFlagsForConfiguration(String extension, IPath inputLocation, IPath outputLocation){ // Treat null extensions as an empty string - String ext = extension == null ? new String() : extension; + String ext = extension == null ? "" : extension; // $NON-NLS-1$ // Get all the tools for the current config ITool[] tools = getFilteredTools(); @@ -480,7 +480,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Override public String getPrebuildStep() { // Get the default configuration and use its value - String name = new String(); + String name = ""; // $NON-NLS-1$ IConfiguration config = getDefaultConfiguration(); if (config != null) { name = config.getPrebuildStep(); @@ -496,7 +496,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Override public String getPostbuildStep() { // Get the default configuration and use its value - String name = new String(); + String name = ""; // $NON-NLS-1$ IConfiguration config = getDefaultConfiguration(); if (config != null) { name = config.getPostbuildStep(); @@ -512,7 +512,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Override public String getPreannouncebuildStep() { // Get the default configuration and use its value - String name = new String(); + String name = ""; // $NON-NLS-1$ IConfiguration config = getDefaultConfiguration(); if (config != null) { name = config.getPreannouncebuildStep(); @@ -528,7 +528,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Override public String getPostannouncebuildStep() { // Get the default configuration and use its value - String name = new String(); + String name = ""; // $NON-NLS-1$ IConfiguration config = getDefaultConfiguration(); if (config != null) { name = config.getPostannouncebuildStep(); @@ -593,7 +593,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { @Override public String getToolForConfiguration(String extension) { // Treat a null argument as an empty string - String ext = extension == null ? new String() : extension; + String ext = extension == null ? "" : extension; // $NON-NLS-1$ // Get all the tools for the current config ITool[] tools = getFilteredTools(); for (int index = 0; index < tools.length; index++) { @@ -1291,7 +1291,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { String[] tokens = val.split("="); //$NON-NLS-1$ String key = tokens[0].trim(); - String value = (tokens.length > 1) ? tokens[1].trim() : new String(); + String value = (tokens.length > 1) ? tokens[1].trim() : ""; // $NON-NLS-1$ // Make sure the current entries do not contain a duplicate boolean add = true; Iterator entryIter = entries.listIterator(); 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 2dcaac27bde..a62d60de053 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 Intel Corporation and others. + * Copyright (c) 2004, 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 @@ -114,7 +114,7 @@ public class ManagedCommandLineGenerator implements } private String stringArrayToString( String[] array ) { - if( array == null || array.length <= 0 ) return new String(); + if( array == null || array.length <= 0 ) return ""; // $NON-NLS-1$ StringBuffer sb = new StringBuffer(); for( int i = 0; i < array.length; i++ ) sb.append( array[i] + WHITESPACE ); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java index eac628e826b..d98c43d36d8 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -42,7 +42,7 @@ import org.osgi.framework.Version; */ public class OptionCategory extends BuildObject implements IOptionCategory { - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; // $NON-NLS-1$ private static final IOptionCategory[] emtpyCategories = new IOptionCategory[0]; // Parent and children diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java index 3a0f28dde79..fd310d8c09d 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java @@ -382,7 +382,7 @@ public class OptionReference implements IOption { return name; } catch (BuildException e) {} } - return new String(); + return ""; // $NON-NLS-1$ } @Override @@ -396,7 +396,7 @@ public class OptionReference implements IOption { return name; } catch (BuildException e) {} } - return new String(); + return ""; // $NON-NLS-1$ } @Override @@ -410,7 +410,7 @@ public class OptionReference implements IOption { return id; } catch (BuildException e) {} } - return new String(); + return ""; // $NON-NLS-1$ } @Override @@ -424,7 +424,7 @@ public class OptionReference implements IOption { return id; } catch (BuildException e) {} } - return new String(); + return ""; // $NON-NLS-1$ } @Override diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java index 5d2bef88583..46c799a54aa 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 Intel Corporation and others. + * Copyright (c) 2005, 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 @@ -387,7 +387,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart IStatus.OK, ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, - new String(), + "", // $NON-NLS-1$ null); } }; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java index 3aa2d51f25c..8f18eb5870b 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java @@ -43,7 +43,7 @@ import org.osgi.framework.Version; public class ResourceConfiguration extends ResourceInfo implements IFileInfo { - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; // $NON-NLS-1$ //property name for holding the rebuild state private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$ @@ -151,7 +151,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { } // Add the resource specific tools to this resource. ITool tools[] = folderInfo.getFilteredTools(); - String subId = new String(); + String subId = ""; // $NON-NLS-1$ for (int i = 0; i < tools.length; i++) { if( tools[i].buildsFileType(extString) ) { baseTool = tools[i]; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java index c20d2bd9a9a..6381ce66be7 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java @@ -40,7 +40,7 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; public class Target extends BuildObject implements ITarget { - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; // $NON-NLS-1$ private String artifactName; private String binaryParserId; private String cleanCommand; 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 0381f24a68c..5592f6514f8 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -179,7 +179,7 @@ public class ToolReference implements IToolReference { outputFlag = tool.getOutputFlag(); outputPrefix = tool.getOutputPrefix(); String[] extensions = tool.getOutputsAttribute(); - outputExtensions = new String(); + outputExtensions = ""; // $NON-NLS-1$ if (extensions != null) { for (int index = 0; index < extensions.length; ++index) { if (extensions[index] == null) continue; @@ -346,7 +346,7 @@ public class ToolReference implements IToolReference { public String getId() { if (parent == null) { // bad reference - return new String(); + return ""; // $NON-NLS-1$ } return parent.getId(); } @@ -358,7 +358,7 @@ public class ToolReference implements IToolReference { public String getBaseId() { if (parent == null) { // bad reference - return new String(); + return ""; // $NON-NLS-1$ } return parent.getBaseId(); } @@ -383,7 +383,7 @@ public class ToolReference implements IToolReference { public String getName() { if (parent == null) { // bad reference - return new String(); + return ""; // $NON-NLS-1$ } return parent.getName(); } @@ -467,7 +467,7 @@ public class ToolReference implements IToolReference { if (parent != null) { return parent.getToolCommand(); } - return new String(); // bad reference + return ""; // bad reference // $NON-NLS-1$ } return command; } @@ -672,7 +672,7 @@ public class ToolReference implements IToolReference { public String getOutputExtension(String inputExtension) { if (parent == null) { // bad reference - return new String(); + return ""; // $NON-NLS-1$ } return parent.getOutputExtension(inputExtension); } @@ -687,7 +687,7 @@ public class ToolReference implements IToolReference { return parent.getOutputFlag(); } else { // We never should be here - return new String(); + return ""; // $NON-NLS-1$ } } return outputFlag; @@ -702,7 +702,7 @@ public class ToolReference implements IToolReference { if (parent != null) { return parent.getOutputPrefix(); } - return new String(); // bad reference + return ""; // bad reference // $NON-NLS-1$ } return outputPrefix; } @@ -864,7 +864,7 @@ public class ToolReference implements IToolReference { */ @Override public String getCommandLinePattern() { - if( parent == null ) return new String(); + if( parent == null ) return ""; // $NON-NLS-1$ return parent.getCommandLinePattern(); } @@ -917,7 +917,7 @@ public class ToolReference implements IToolReference { */ @Override public String toString() { - String answer = new String(); + String answer = ""; // $NON-NLS-1$ if (parent != null) { answer += "Reference to " + parent.getName(); //$NON-NLS-1$ } @@ -1281,7 +1281,7 @@ public class ToolReference implements IToolReference { if (parent != null) { return parent.getConvertToId(); } else { - return new String(); + return ""; // $NON-NLS-1$ } } return convertToId; @@ -1310,7 +1310,7 @@ public class ToolReference implements IToolReference { if (parent != null) { return parent.getVersionsSupported(); } else { - return new String(); + return ""; // $NON-NLS-1$ } } return versionsSupported; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckStringExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckStringExpression.java index 6b7f345f025..5bc1f7e40ea 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckStringExpression.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckStringExpression.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 Intel Corporation and others. + * Copyright (c) 2005, 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 @@ -39,11 +39,11 @@ public class CheckStringExpression implements IBooleanExpression { public CheckStringExpression(IManagedConfigElement element){ fString = element.getAttribute(STRING); if(fString == null) - fString = new String(); + fString = ""; // $NON-NLS-1$ fValue = element.getAttribute(VALUE); if(fValue == null) - fValue = new String(); + fValue = ""; // $NON-NLS-1$ fIsRegex = OptionEnablementExpression.getBooleanValue(element.getAttribute(IS_REGEX)); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGnuWinScannerInfoCollector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGnuWinScannerInfoCollector.java index 5e4ada508cd..13f7cf6975f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGnuWinScannerInfoCollector.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGnuWinScannerInfoCollector.java @@ -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 @@ -60,7 +60,7 @@ public class DefaultGnuWinScannerInfoCollector extends DefaultGCCScannerInfoColl // // See if it has an equals // String[] macroTokens = ((String)symbolIter.next()).split(EQUALS); // String macro = macroTokens[0].trim(); -// String value = (macroTokens.length > 1) ? macroTokens[1].trim() : new String(); +// String value = (macroTokens.length > 1) ? macroTokens[1].trim() : ""; // $NON-NLS-1$ // getDefinedSymbols().put(macro, value); // } super.contributeToScannerConfig(resource, scannerInfo); 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 a7ef0f8ff4b..4b6a3f6ea87 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 @@ -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 @@ -35,7 +35,7 @@ import org.eclipse.core.resources.IResource; */ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerator { - private static final String EMPTY_STRING = new String(); + 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 +80,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat // Work out the build-relative path for the output files IContainer resourceLocation = resource.getParent(); - String relativePath = new String(); + String relativePath = ""; // $NON-NLS-1$ if (resourceLocation != null) { relativePath += resourceLocation.getProjectRelativePath().toString(); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3Commands.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3Commands.java index d217c11fdc4..89b9bf37b0a 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3Commands.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3Commands.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 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 @@ -50,7 +50,7 @@ import org.eclipse.core.runtime.IPath; public class DefaultGCCDependencyCalculator3Commands implements IManagedDependencyCommands { - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; // $NON-NLS-1$ // Member variables set by the constructor IPath source; 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 8646c2dbb47..88ce709d0c8 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -439,7 +439,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { if (buildTargetExt == null) { - buildTargetExt = new String(); + buildTargetExt = ""; // $NON-NLS-1$ } // Cache the build tools config = info.getDefaultConfiguration(); @@ -651,7 +651,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { status = new MultiStatus( ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.INFO, - new String(), + "", // $NON-NLS-1$ null); status.add(new Status ( IStatus.INFO, @@ -753,7 +753,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { status = new MultiStatus ( ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.WARNING, - new String(), + "", // $NON-NLS-1$ null); // Add a new status for each of the bad folders // TODO: fix error message @@ -770,7 +770,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { status = new MultiStatus( ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, - new String(), + "", // $NON-NLS-1$ null); } @@ -906,7 +906,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { status = new MultiStatus( ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.INFO, - new String(), + "", // $NON-NLS-1$ null); status.add(new Status ( IStatus.INFO, @@ -965,7 +965,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { status = new MultiStatus ( ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.WARNING, - new String(), + "", // $NON-NLS-1$ null); // Add a new status for each of the bad folders // TODO: fix error message @@ -981,7 +981,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { status = new MultiStatus( ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, - new String(), + "", // $NON-NLS-1$ null); } return status; @@ -2822,7 +2822,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { } if (addlDeps != null && addlDeps.length > 0) { - calculatedDependencies = new String(); + calculatedDependencies = ""; // $NON-NLS-1$ for (IPath addlDep : addlDeps) { calculatedDependencies += WHITESPACE + escapeWhitespaces(addlDep.toString()); } @@ -3651,7 +3651,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { try { secondToken = deps.get(1); } catch (ArrayIndexOutOfBoundsException e) { - secondToken = new String(); + secondToken = ""; // $NON-NLS-1$ } if (secondToken.startsWith("'")) { //$NON-NLS-1$ // This is the Win32 implementation of echo (MinGW without MSYS) @@ -3665,7 +3665,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { try { thirdToken = deps.get(2); } catch (ArrayIndexOutOfBoundsException e) { - thirdToken = new String(); + thirdToken = ""; // $NON-NLS-1$ } int lastIndex = thirdToken.lastIndexOf("'"); //$NON-NLS-1$ if (lastIndex != -1) { @@ -3689,7 +3689,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { } while (fourthToken.length() == 0); } catch (ArrayIndexOutOfBoundsException e) { - fourthToken = new String(); + fourthToken = ""; // $NON-NLS-1$ } outBuffer.append(fourthToken + WHITESPACE); @@ -4514,7 +4514,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { * the name component in a String */ private String getFileName(IResource file) { - String answer = new String(); + String answer = ""; // $NON-NLS-1$ String lastSegment = file.getName(); int extensionSeparator = lastSegment.lastIndexOf(DOT); if (extensionSeparator != -1) { @@ -4676,7 +4676,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { if (buildTargetExt == null) { - buildTargetExt = new String(); + buildTargetExt = ""; // $NON-NLS-1$ } // Cache the build tools config = cfg; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java index 393fc67145f..db46c6e6f82 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java @@ -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 @@ -92,8 +92,8 @@ public class MakeScannerInfo implements IScannerInfo { if (symbol.length() == 0) { continue; } - String key = new String(); - String value = new String(); + String key = ""; // $NON-NLS-1$ + String value = ""; // $NON-NLS-1$ int index = symbol.indexOf("="); //$NON-NLS-1$ if (index != -1) { key = symbol.substring(0, index).trim(); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java index 55873468916..a9131a7e76e 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2010 IBM Corporation and others. + * Copyright (c) 2002, 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 @@ -132,7 +132,7 @@ public class BuildOptionComboFieldEditor extends FieldEditor { public void widgetSelected(SelectionEvent evt) { String oldValue = selected; int index = optionSelector.getSelectionIndex(); - selected = index == -1 ? new String() : optionSelector.getItem(index); + selected = index == -1 ? "" : optionSelector.getItem(index); // $NON-NLS-1$ setPresentsDefaultValue(false); fireValueChanged(VALUE, oldValue, selected); } @@ -171,7 +171,7 @@ public class BuildOptionComboFieldEditor extends FieldEditor { protected void doStore() { // Save the selected item in the store int index = optionSelector.getSelectionIndex(); - selected = index == -1 ? new String() : optionSelector.getItem(index); + selected = index == -1 ? "" : optionSelector.getItem(index); // $NON-NLS-1$ getPreferenceStore().setValue(getPreferenceName(), selected); } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java index b9e0ec7d679..886bcc323f4 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java @@ -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 @@ -273,7 +273,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab { rcbsTool = rcConfig.createTool(null,rcbsToolId + "." + ManagedBuildManager.getRandomNumber(),rcbsToolName,false); //$NON-NLS-1$ rcbsTool.setCustomBuildStep(true); IInputType rcbsToolInputType = rcbsTool.createInputType(null,rcbsToolInputTypeId + "." + ManagedBuildManager.getRandomNumber(),rcbsToolInputTypeName,false); //$NON-NLS-1$ - IAdditionalInput rcbsToolInputTypeAdditionalInput = rcbsToolInputType.createAdditionalInput(new String()); + IAdditionalInput rcbsToolInputTypeAdditionalInput = rcbsToolInputType.createAdditionalInput(""); // $NON-NLS-1$ rcbsToolInputTypeAdditionalInput.setKind(IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY); rcbsTool.createOutputType(null,rcbsToolOutputTypeId + "." + ManagedBuildManager.getRandomNumber(),rcbsToolOutputTypeName,false); //$NON-NLS-1$ } @@ -298,7 +298,7 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab { private String createList(String[] items) { if(items == null) - return new String(); + return ""; // $NON-NLS-1$ StringBuffer path = new StringBuffer(EMPTY_STR); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewBuildConfigurationDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewBuildConfigurationDialog.java index a11dac24d23..b8d02180488 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewBuildConfigurationDialog.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewBuildConfigurationDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -88,8 +88,8 @@ public class NewBuildConfigurationDialog extends Dialog { des = prjd; setShellStyle(getShellStyle()|SWT.RESIZE); - newName = new String(); - newDescription = new String(); + newName = ""; // $NON-NLS-1$ + newDescription = ""; // $NON-NLS-1$ parentConfig = null; // The default behaviour is to clone the settings @@ -110,9 +110,9 @@ public class NewBuildConfigurationDialog extends Dialog { @Override protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.OK_ID) { - String description = new String(); - String nameAndDescription = new String(); - String baseConfigNameAndDescription = new String(); + String description = ""; // $NON-NLS-1$ + String nameAndDescription = ""; // $NON-NLS-1$ + String baseConfigNameAndDescription = ""; // $NON-NLS-1$ newName = configName.getText().trim(); newDescription = configDescription.getText().trim(); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java index 524d6d2a61e..608814b92d9 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 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 @@ -413,8 +413,8 @@ public class NewCfgDialog implements INewCfgDialog { /** */ public NewCfgDialog() { - newName = new String(); - newDescription = new String(); + newName = ""; // $NON-NLS-1$ + newDescription = ""; // $NON-NLS-1$ } @Override diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java index ba932050abf..5ebd26f03ab 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 Intel Corporation and others. + * Copyright (c) 2005, 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 @@ import com.ibm.icu.text.Collator; * @noinstantiate This class is not intended to be instantiated by clients. */ public class NewVarDialog extends Dialog { - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; // $NON-NLS-1$ // The title of the dialog. private String fTitle; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/AbstractEntryStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/AbstractEntryStorage.java index 3323be43669..ab1e0d2f151 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/AbstractEntryStorage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/AbstractEntryStorage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 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 @@ -20,7 +20,7 @@ import org.eclipse.cdt.core.settings.model.util.SettingsSet.SettingLevel; public abstract class AbstractEntryStorage { private int fKind; - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; // $NON-NLS-1$ public AbstractEntryStorage(int kind){ fKind = kind; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java index 51dc3312ae1..1da816d5f98 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java @@ -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 @@ -46,7 +46,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction { @Override public String getParameterInitializer(int pos) { // TODO Auto-generated method stub - return new String(); + return ""; // $NON-NLS-1$ } /* (non-Javadoc) @@ -64,7 +64,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction { @Override public String getReturnType() { // TODO Auto-generated method stub - return new String(); + return ""; // $NON-NLS-1$ } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PE.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PE.java index c6886561e56..e42cc1d98a2 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PE.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PE.java @@ -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 @@ -885,7 +885,7 @@ public class PE { } } - return new String(); + return ""; // $NON-NLS-1$ } /** diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java index 0a70433f559..8b9922a34ee 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java @@ -695,9 +695,9 @@ public class Dwarf { ByteBuffer data = dwarfSections.get(DWARF_DEBUG_STR); if (data == null) { - obj = new String(); + obj = ""; // $NON-NLS-1$ } else if (offset < 0 || offset > data.capacity()) { - obj = new String(); + obj = ""; // $NON-NLS-1$ } else { StringBuffer sb = new StringBuffer(); data.position((int) offset); @@ -723,9 +723,9 @@ public class Dwarf { ByteBuffer data = dwarfAltSections.get(DWARF_DEBUG_STR); if (data == null) { - obj = new String(); + obj = ""; // $NON-NLS-1$ } else if (offset < 0 || offset > data.capacity()) { - obj = new String(); + obj = ""; // $NON-NLS-1$ } else { StringBuffer sb = new StringBuffer(); data.position((int) offset); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/Stabs.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/Stabs.java index 3ed97cb58b2..5b7f2803733 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/Stabs.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/Stabs.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 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 @@ -188,7 +188,7 @@ public class Stabs { if (stroff > 0) { field = makeString(stroff); } else { - field = new String(); + field = ""; // $NON-NLS-1$ } // Check for continuation and if any go to the next stab // until we find a string that is not terminated with a diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StabsReader.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StabsReader.java index 76f2d7f0349..8c07cd75efc 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StabsReader.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StabsReader.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 Nokia and others. + * Copyright (c) 2006, 2016 Nokia 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 @@ -177,7 +177,7 @@ public class StabsReader implements ISymbolReader { if (stroff > 0) { field = makeString(stroff); } else { - field = new String(); + field = ""; // $NON-NLS-1$ } // Check for continuation and if any go to the next stab // until we find a string that is not terminated with a diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StringField.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StringField.java index 2c52b745d70..59858b9a5fc 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StringField.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/stabs/StringField.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 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 @@ -98,7 +98,7 @@ public class StringField { if (index < array.length) { typeInformation = new String(array, index, array.length - index); } else { - typeInformation = new String(); + typeInformation = ""; // $NON-NLS-1$ } } } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java index 64e7103a6b1..3fc47ad77a1 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/chelp/CHelpProviderTester.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2004, 2012 Intel Corporation and others. + * Copyright (c) 2004, 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 @@ -217,7 +217,7 @@ public class CHelpProviderTester{ private String getValueByKey(String key){ String val = fProperties.getProperty(key); if(val == null) - val = new String(); + val = ""; // $NON-NLS-1$ return val; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IndentUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IndentUtil.java index 7718d026f73..e6c942ab46a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IndentUtil.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IndentUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 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 @@ -523,7 +523,7 @@ public final class IndentUtil { if (computed != null) indent= computed.toString(); else - indent= new String(); + indent= ""; // $NON-NLS-1$ } return indent; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java index 73038e9bd89..f262c701db9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2013 TimeSys Corporation and others. + * Copyright (c) 2004, 2016 TimeSys 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 @@ -141,7 +141,7 @@ public class CFileTypesPreferenceBlock { } else if (assoc.isPredefined()) { return PreferencesMessages.CFileTypesPreferencePage_preDefined; } - return new String(); + return ""; // $NON-NLS-1$ } } return element.toString(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java index ab2e26e031a..1ed8810d75c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2015 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -44,7 +44,7 @@ public class CSearchUtil { public static String toString(IWorkingSet[] workingSets) { if (workingSets != null && workingSets.length > 0) { - String string = new String(); + String string = ""; // $NON-NLS-1$ for (int i = 0; i < workingSets.length; i++) { if (i > 0) string += ", "; //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/NewConfigurationDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/NewConfigurationDialog.java index 21af4581ab1..ef7eec48a2c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/NewConfigurationDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/NewConfigurationDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -62,8 +62,8 @@ public class NewConfigurationDialog extends Dialog implements INewCfgDialog { protected NewConfigurationDialog(Shell parentShell) { super(parentShell); setShellStyle(getShellStyle()|SWT.RESIZE); - newName = new String(); - newDescription = new String(); + newName = ""; // $NON-NLS-1$ + newDescription = ""; // $NON-NLS-1$ } @Override @@ -85,9 +85,9 @@ public class NewConfigurationDialog extends Dialog implements INewCfgDialog { @Override protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.OK_ID) { - String description = new String(); - String nameAndDescription = new String(); - String baseConfigNameAndDescription = new String(); + String description = ""; // $NON-NLS-1$ + String nameAndDescription = ""; // $NON-NLS-1$ + String baseConfigNameAndDescription = ""; // $NON-NLS-1$ newName = configName.getText().trim(); newDescription = configDescription.getText().trim(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RenameConfigurationDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RenameConfigurationDialog.java index eb9b9cbe99a..5e9751f704c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RenameConfigurationDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RenameConfigurationDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 Intel Corporation and others. + * Copyright (c) 2005, 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 @@ -64,7 +64,7 @@ public class RenameConfigurationDialog extends Dialog { setShellStyle(getShellStyle()|SWT.RESIZE); newName = renameConfig.getName(); newDescription = renameConfig.getDescription(); - if(newDescription == null) newDescription = new String(); + if(newDescription == null) newDescription = ""; // $NON-NLS-1$ originalName = renameConfig.getName(); } diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java index f615bdb5fd8..ea795146508 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 Symbian Software Limited and others. + * Copyright (c) 2005, 2016 Symbian Software Limited 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 @@ -69,7 +69,7 @@ public class UIStringListWidget extends InputUIElement { @Override public Map getValues() { Map retMap = new HashMap(); - String itemString = new String(); + String itemString = ""; // $NON-NLS-1$ for (int i = 0; i < itemsList.size(); i++) { itemString = itemString + itemsList.get(i) + "|"; //$NON-NLS-1$ } diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java index 67befa3cdd0..f53479b218a 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 Symbian Software Limited and others. + * Copyright (c) 2007, 2016 Symbian Software Limited 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 @@ -72,7 +72,7 @@ public class UITextWidget extends InputUIElement implements ModifyListener { */ public UITextWidget(UIAttributes uiAttribute) { super(uiAttribute); - this.textValue = new String(); + this.textValue = ""; // $NON-NLS-1$ } /** diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java index b3fa1da8153..3d7de02ab53 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java @@ -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 @@ -33,7 +33,7 @@ public class MICommand implements ICommand { List fOptions = new ArrayList<>(); List fParameters = new ArrayList<>(); - String fOperation = new String(); + String fOperation = ""; // $NON-NLS-1$ IDMContext fCtx; /* diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDataDisassemble.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDataDisassemble.java index ae8109653be..16a0afc81b8 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDataDisassemble.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDataDisassemble.java @@ -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 @@ -115,7 +115,7 @@ public class MIDataDisassemble extends MICommand { if (parameters != null && parameters.length > 0) { return "-- " + parameters[0]; //$NON-NLS-1$ } - return new String(); + return ""; // $NON-NLS-1$ } @Override diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMDelta.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMDelta.java index b071beab1e0..1c31dd4e5ae 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMDelta.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMDelta.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 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 @@ -280,7 +280,7 @@ public class VMDelta extends ModelDelta { } private void appendDetail(StringBuilder buf, VMDelta delta, int depth) { - String indent = new String(); + String indent = ""; // $NON-NLS-1$ for (int i = 0; i < depth; i++) { indent += '\t'; } diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java index 9d443237e20..70967c6fca4 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 QNX Software Systems and others. + * Copyright (c) 2005, 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 @@ -255,7 +255,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab { } public String get() { - String result = new String(); + String result = ""; // $NON-NLS-1$ Object[] entries = fElements.entrySet().toArray(); for (int i = 0; i < entries.length; ++i) result += entries[i].toString() + '\n'; @@ -366,7 +366,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab { } protected void newEntry() { - EntryDialog dialog = new EntryDialog(new String(), new String(), false); + EntryDialog dialog = new EntryDialog("", "", false); // $NON-NLS-1$ // $NON-NLS-2$ if (dialog.open() == Window.OK) { fElements.setProperty(dialog.getName(), dialog.getValue()); fVariableList.refresh();