1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 491984 - Replace .equals("") with .isEmpty()

In many cases a String's empty status is tested with `.equals("")`.
However, Java 1.6 added `.isEmpty()` which can be more efficient since
it compares the internal length parameter only for testing. Replace
code using the `.isEmpty()` variant instead.

Some tests for `"".equals(expr)` can be replaced with `expr.isEmpty()`
where it is already known that the `expr` is not null; however,
these have to be reviewed on a case-by-case basis.

Change-Id: I3c6af4d8b7638e757435914ac76cb3a67899a5fd
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
This commit is contained in:
Alex Blewitt 2016-04-19 11:35:21 +01:00 committed by Gerrit Code Review @ Eclipse.org
parent 10ba077124
commit 2114f6b108
82 changed files with 190 additions and 190 deletions

View file

@ -410,7 +410,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
if (target == null) if (target == null)
target = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT; target = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT;
String args = builder.getBuildArguments(); String args = builder.getBuildArguments();
if (args != null && !(args = args.trim()).equals("")) { //$NON-NLS-1$ if (args != null && !(args = args.trim()).isEmpty()) {
String[] newArgs = makeArray(args); String[] newArgs = makeArray(args);
makeargs = new String[newArgs.length + 1]; makeargs = new String[newArgs.length + 1];
System.arraycopy(newArgs, 0, makeargs, 0, newArgs.length); System.arraycopy(newArgs, 0, makeargs, 0, newArgs.length);
@ -460,7 +460,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
if (target == null) if (target == null)
target = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT; target = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT;
String args = builder.getBuildArguments(); String args = builder.getBuildArguments();
if (args != null && !(args = args.trim()).equals("")) { //$NON-NLS-1$ if (args != null && !(args = args.trim()).isEmpty()) {
String[] newArgs = makeArray(args); String[] newArgs = makeArray(args);
makeargs = new String[newArgs.length + 1]; makeargs = new String[newArgs.length + 1];
System.arraycopy(newArgs, 0, makeargs, 0, newArgs.length); System.arraycopy(newArgs, 0, makeargs, 0, newArgs.length);

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -302,12 +302,12 @@ public class AutotoolsConfiguration implements IAConfiguration {
for (int j = 0; j < childOptions.length; ++j) { for (int j = 0; j < childOptions.length; ++j) {
IConfigureOption childOption = getOption(childOptions[j].getName()); IConfigureOption childOption = getOption(childOptions[j].getName());
String parameter = childOption.getParameter(); String parameter = childOption.getParameter();
if (!parameter.equals("")) if (!parameter.isEmpty())
buf.append(" " + parameter); buf.append(" " + parameter);
} }
} else { } else {
String parameter = option.getParameter(); String parameter = option.getParameter();
if (!parameter.equals("")) if (!parameter.isEmpty())
buf.append(" " + parameter); buf.append(" " + parameter);
} }
} }

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -53,7 +53,7 @@ public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler
ICConfigurationDescription cfgd = ManagedBuildManager.getDescriptionForConfiguration(configuration); ICConfigurationDescription cfgd = ManagedBuildManager.getDescriptionForConfiguration(configuration);
if (option.getName().equals("Name") && cfgd != null) { if (option.getName().equals("Name") && cfgd != null) {
String cfgId = cfgd.getId(); String cfgId = cfgd.getId();
if (!value.equals("") && !value.equals(cfgId)) { if (!value.isEmpty() && !value.equals(cfgId)) {
// we have a cloned configuration and we know that the // we have a cloned configuration and we know that the
// clonee's name is the value of the option // clonee's name is the value of the option
IProject project = (IProject)configuration.getManagedProject().getOwner(); IProject project = (IProject)configuration.getManagedProject().getOwner();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2015 Symbian Software Limited and others. * Copyright (c) 2007, 2016 Symbian Software Limited and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -66,7 +66,7 @@ public class NewAutotoolsProject extends ProcessRunner {
turnOffAutoBuild(workspace); turnOffAutoBuild(workspace);
IPath locationPath = null; IPath locationPath = null;
if (location != null && !location.trim().equals("")) { //$NON-NLS-1$ if (location != null && !location.trim().isEmpty()) {
locationPath = Path.fromPortableString(location); locationPath = Path.fromPortableString(location);
} }

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -119,7 +119,7 @@ public class AutotoolsBuildPropertyPage extends AbstractCBuildPropertyTab {
}); });
fCleanMakeTarget.addModifyListener(e -> { fCleanMakeTarget.addModifyListener(e -> {
if (fCleanMakeTarget.getText().equals("")) { // $NON-NLS-1$ if (fCleanMakeTarget.getText().isEmpty()) {
// FIXME: should probably issue warning here, but how? // FIXME: should probably issue warning here, but how?
} }
}); });

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -314,7 +314,7 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
NamedNodeMap parms = v.getAttributes(); NamedNodeMap parms = v.getAttributes();
Node parmNode = parms.item(0); Node parmNode = parms.item(0);
String parm = parmNode.getNodeValue(); String parm = parmNode.getNodeValue();
if (prototype.toString().equals("")) if (prototype.toString().isEmpty())
prototype.append(parm); prototype.append(parm);
else else
prototype.append(", " + parm); prototype.append(", " + parm);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2015 Rational Software Corporation and others. * Copyright (c) 2002, 2016 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -29,7 +29,7 @@ public class ConfigurationLabelProvider extends LabelProvider implements ITableL
if (obj instanceof IConfiguration) { if (obj instanceof IConfiguration) {
IConfiguration tmpConfig = (IConfiguration) obj; IConfiguration tmpConfig = (IConfiguration) obj;
if( (tmpConfig.getDescription() == null)|| (tmpConfig.getDescription().equals("")) ) //$NON-NLS-1$ if( (tmpConfig.getDescription() == null)|| (tmpConfig.getDescription().isEmpty()) )
return ((IConfiguration) obj).getName(); return ((IConfiguration) obj).getName();
else else
return ( tmpConfig.getName() + " ( " + tmpConfig.getDescription() + " )"); //$NON-NLS-1$ //$NON-NLS-2$ return ( tmpConfig.getName() + " ( " + tmpConfig.getDescription() + " )"); //$NON-NLS-1$ //$NON-NLS-2$

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -262,7 +262,7 @@ public class MakeBuilder extends ACBuilder {
} }
} else { } else {
String argsStr = info.getBuildArguments(); String argsStr = info.getBuildArguments();
if (argsStr != null && !argsStr.equals("")) { //$NON-NLS-1$ if (argsStr != null && !argsStr.isEmpty()) {
String[] newArgs = makeArray(argsStr); String[] newArgs = makeArray(argsStr);
args = new String[targets.length + newArgs.length]; args = new String[targets.length + newArgs.length];
System.arraycopy(newArgs, 0, args, 0, newArgs.length); System.arraycopy(newArgs, 0, args, 0, newArgs.length);

View file

@ -256,7 +256,7 @@ public class ProjectTargets {
if (node.getName().equals(TARGET_ELEMENT)) { if (node.getName().equals(TARGET_ELEMENT)) {
IContainer container = null; IContainer container = null;
String path = node.getAttribute(TARGET_ATTR_PATH); String path = node.getAttribute(TARGET_ATTR_PATH);
if (path != null && !path.equals("")) { //$NON-NLS-1$ if (path != null && !path.isEmpty()) {
container = project.getFolder(path); container = project.getFolder(path);
} else { } else {
container = project; container = project;

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -148,7 +148,7 @@ public class MultipleInputDialog extends Dialog {
validators.add(new Validator() { validators.add(new Validator() {
@Override @Override
public boolean validate() { public boolean validate() {
return !text.getText().equals(""); //$NON-NLS-1$ return !text.getText().isEmpty();
} }
}); });
text.addModifyListener(new ModifyListener() { text.addModifyListener(new ModifyListener() {
@ -191,7 +191,7 @@ public class MultipleInputDialog extends Dialog {
validators.add(new Validator() { validators.add(new Validator() {
@Override @Override
public boolean validate() { public boolean validate() {
return !text.getText().equals(""); //$NON-NLS-1$ return !text.getText().isEmpty();
} }
}); });
@ -210,7 +210,7 @@ public class MultipleInputDialog extends Dialog {
DirectoryDialog dialog = new DirectoryDialog(getShell()); DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setMessage(MakeUIPlugin.getResourceString("MultipleInputDialog.1")); //$NON-NLS-1$ dialog.setMessage(MakeUIPlugin.getResourceString("MultipleInputDialog.1")); //$NON-NLS-1$
String currentWorkingDir = text.getText(); String currentWorkingDir = text.getText();
if (!currentWorkingDir.trim().equals("")) { //$NON-NLS-1$ if (!currentWorkingDir.trim().isEmpty()) {
File path = new File(currentWorkingDir); File path = new File(currentWorkingDir);
if (path.exists()) { if (path.exists()) {
dialog.setFilterPath(currentWorkingDir); dialog.setFilterPath(currentWorkingDir);
@ -258,7 +258,7 @@ public class MultipleInputDialog extends Dialog {
validators.add(new Validator() { validators.add(new Validator() {
@Override @Override
public boolean validate() { public boolean validate() {
return !text.getText().equals(""); //$NON-NLS-1$ return !text.getText().isEmpty();
} }
}); });

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -288,7 +288,7 @@ public class MakeTargetDialog extends Dialog {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
if (useBuilderCommandCheckBox.getSelection() == true) { if (useBuilderCommandCheckBox.getSelection() == true) {
StringBuffer cmd = new StringBuffer(builderCommand.toString()); StringBuffer cmd = new StringBuffer(builderCommand.toString());
if (builderArguments != null && !builderArguments.equals("")) { //$NON-NLS-1$ if (builderArguments != null && !builderArguments.isEmpty()) {
cmd.append(" "); //$NON-NLS-1$ cmd.append(" "); //$NON-NLS-1$
cmd.append(builderArguments); cmd.append(builderArguments);
} }
@ -399,7 +399,7 @@ public class MakeTargetDialog extends Dialog {
targetNameText.selectAll(); targetNameText.selectAll();
if (targetBuildCommand != null) { if (targetBuildCommand != null) {
StringBuffer cmd = new StringBuffer(targetBuildCommand.toOSString()); StringBuffer cmd = new StringBuffer(targetBuildCommand.toOSString());
if (targetBuildArguments != null && !targetBuildArguments.equals("")) { //$NON-NLS-1$ if (targetBuildArguments != null && !targetBuildArguments.isEmpty()) {
cmd.append(" "); //$NON-NLS-1$ cmd.append(" "); //$NON-NLS-1$
cmd.append(targetBuildArguments); cmd.append(targetBuildArguments);
} }

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -178,7 +178,7 @@ public class SettingsBlock extends AbstractCOptionPage {
StringBuffer cmd = new StringBuffer(fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, "")); //$NON-NLS-1$ StringBuffer cmd = new StringBuffer(fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, "")); //$NON-NLS-1$
if (!fBuildInfo.isDefaultBuildCmd()) { if (!fBuildInfo.isDefaultBuildCmd()) {
String args = fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, ""); //$NON-NLS-1$ String args = fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, ""); //$NON-NLS-1$
if (args != null && !args.equals("")) { //$NON-NLS-1$ if (args != null && !args.isEmpty()) {
cmd.append(" "); //$NON-NLS-1$ cmd.append(" "); //$NON-NLS-1$
cmd.append(args); cmd.append(args);
} }
@ -545,7 +545,7 @@ public class SettingsBlock extends AbstractCOptionPage {
StringBuffer cmd = new StringBuffer(info.getBuildCommand().toOSString()); StringBuffer cmd = new StringBuffer(info.getBuildCommand().toOSString());
if (!info.isDefaultBuildCmd()) { if (!info.isDefaultBuildCmd()) {
String args = info.getBuildArguments(); String args = info.getBuildArguments();
if (args != null && !args.equals("")) { //$NON-NLS-1$ if (args != null && !args.isEmpty()) {
cmd.append(" "); //$NON-NLS-1$ cmd.append(" "); //$NON-NLS-1$
cmd.append(args); cmd.append(args);
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -423,11 +423,11 @@ public class OptionEnablementTests extends TestCase implements IManagedOptionVal
option = tool.getOptionBySuperClassId("enablement.checkOpt.all.Q.this.string.Q.empty"); option = tool.getOptionBySuperClassId("enablement.checkOpt.all.Q.this.string.Q.empty");
assertEquals(option.getCommand(), "cmd"); assertEquals(option.getCommand(), "cmd");
assertEquals(option.getCommandFalse(), "cmdF"); assertEquals(option.getCommandFalse(), "cmdF");
assertEquals(thisString.getStringValue().equals(""), assertEquals(thisString.getStringValue().isEmpty(),
option.getApplicabilityCalculator().isOptionUsedInCommandLine(cfg, tool, option)); option.getApplicabilityCalculator().isOptionUsedInCommandLine(cfg, tool, option));
assertEquals(thisString.getStringValue().equals(""), assertEquals(thisString.getStringValue().isEmpty(),
option.getApplicabilityCalculator().isOptionVisible(cfg, tool, option)); option.getApplicabilityCalculator().isOptionVisible(cfg, tool, option));
assertEquals(thisString.getStringValue().equals(""), assertEquals(thisString.getStringValue().isEmpty(),
option.getApplicabilityCalculator().isOptionEnabled(cfg, tool, option)); option.getApplicabilityCalculator().isOptionEnabled(cfg, tool, option));
option = tool.getOptionBySuperClassId("enablement.checkOpt.all.Q.this.string.Q.test a b c"); option = tool.getOptionBySuperClassId("enablement.checkOpt.all.Q.this.string.Q.test a b c");

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2010 Symbian Software Limited and others. * Copyright (c) 2010, 2016 Symbian Software Limited and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -131,7 +131,7 @@ public class TemplateEngineTestsHelper {
IProjectType type = allProjectTypes[index]; IProjectType type = allProjectTypes[index];
if (!type.isAbstract() && !type.isTestProjectType()) { if (!type.isAbstract() && !type.isTestProjectType()) {
if (!type.getConvertToId().equals("")) //$NON-NLS-1$ if (!type.getConvertToId().isEmpty())
continue; continue;
if (type.isSupported()) { if (type.isSupported()) {

View file

@ -1562,7 +1562,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
.getVersionsSupported(); .getVersionsSupported();
if ((versionsSupported != null) if ((versionsSupported != null)
&& (!versionsSupported.equals(""))) { //$NON-NLS-1$ && (!versionsSupported.isEmpty())) {
String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$ String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$
for (int j = 0; j < tmpVersions.length; j++) { for (int j = 0; j < tmpVersions.length; j++) {
@ -1597,7 +1597,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
// If 'getSuperClass()' is not null, look for 'convertToId' attribute in plugin // If 'getSuperClass()' is not null, look for 'convertToId' attribute in plugin
// manifest file for this builder. // manifest file for this builder.
String convertToId = getSuperClass().getConvertToId(); String convertToId = getSuperClass().getConvertToId();
if ((convertToId == null) || (convertToId.equals(""))) { //$NON-NLS-1$ if ((convertToId == null) || (convertToId.isEmpty())) {
// It means there is no 'convertToId' attribute available and // It means there is no 'convertToId' attribute available and
// the version is still actively // the version is still actively
// supported by the tool integrator. So do nothing, just return // supported by the tool integrator. So do nothing, just return

View file

@ -605,7 +605,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
public boolean checkForMigrationSupport() { public boolean checkForMigrationSupport() {
String convertToId = getConvertToId(); String convertToId = getConvertToId();
if ((convertToId == null) || (convertToId.equals(""))) { //$NON-NLS-1$ if ((convertToId == null) || (convertToId.isEmpty())) {
// It means there is no 'convertToId' attribute available and // It means there is no 'convertToId' attribute available and
// the project type is still actively // the project type is still actively
// supported by the tool integrator. So do nothing, just return // supported by the tool integrator. So do nothing, just return

View file

@ -586,7 +586,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
break; break;
} }
} }
if (!rcbsToolId.equals("")){ // $NON-NLS-1$ if (!rcbsToolId.isEmpty()){
/* /*
* Here if an rcbs tool is defined. * Here if an rcbs tool is defined.
* Apply the tools according to the current rcbsApplicability setting. * Apply the tools according to the current rcbsApplicability setting.

View file

@ -3231,7 +3231,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
.getVersionsSupported(); .getVersionsSupported();
if ((versionsSupported != null) if ((versionsSupported != null)
&& (!versionsSupported.equals(""))) { //$NON-NLS-1$ && (!versionsSupported.isEmpty())) {
String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$ String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$
for (String tmpVersion : tmpVersions) { for (String tmpVersion : tmpVersions) {
@ -3269,7 +3269,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
// attribute in plugin // attribute in plugin
// manifest file for this tool. // manifest file for this tool.
String convertToId = getSuperClass().getConvertToId(); String convertToId = getSuperClass().getConvertToId();
if ((convertToId == null) || (convertToId.equals(""))) { //$NON-NLS-1$ if ((convertToId == null) || (convertToId.isEmpty())) {
// It means there is no 'convertToId' attribute available and // It means there is no 'convertToId' attribute available and
// the version is still actively // the version is still actively
// supported by the tool integrator. So do nothing, just return // supported by the tool integrator. So do nothing, just return

View file

@ -1894,7 +1894,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
String versionsSupported = toolChainElement.getVersionsSupported(); String versionsSupported = toolChainElement.getVersionsSupported();
if ((versionsSupported != null) if ((versionsSupported != null)
&& (!versionsSupported.equals(""))) { //$NON-NLS-1$ && (!versionsSupported.isEmpty())) {
String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$ String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$
for (int j = 0; j < tmpVersions.length; j++) { for (int j = 0; j < tmpVersions.length; j++) {
@ -1927,7 +1927,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// If 'getSuperClass()' is not null, look for 'convertToId' attribute in plugin // If 'getSuperClass()' is not null, look for 'convertToId' attribute in plugin
// manifest file for this toolchain. // manifest file for this toolchain.
String convertToId = getSuperClass().getConvertToId(); String convertToId = getSuperClass().getConvertToId();
if ((convertToId == null) || (convertToId.equals(""))) { //$NON-NLS-1$ if ((convertToId == null) || (convertToId.isEmpty())) {
// It means there is no 'convertToId' attribute available and // It means there is no 'convertToId' attribute available and
// the version is still actively // the version is still actively
// supported by the tool integrator. So do nothing, just return // supported by the tool integrator. So do nothing, just return

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2012 Intel Corporation and others. * Copyright (c) 2005, 2016 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -66,7 +66,7 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
@Override @Override
public String[] resolveBuildPaths(int pathType, String variableName, String variableValue, IConfiguration configuration) { public String[] resolveBuildPaths(int pathType, String variableName, String variableValue, IConfiguration configuration) {
if (fDelimiter == null || "".equals(fDelimiter)) //$NON-NLS-1$ if (fDelimiter == null || fDelimiter.isEmpty())
return new String[]{variableValue}; return new String[]{variableValue};
List<String> list = EnvVarOperationProcessor.convertToList(variableValue,fDelimiter); List<String> list = EnvVarOperationProcessor.convertToList(variableValue,fDelimiter);
@ -89,7 +89,7 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
@Override @Override
public IBuildEnvironmentVariable getVariable(String variableName, Object level, boolean includeParentLevels, boolean resolveMacros) { public IBuildEnvironmentVariable getVariable(String variableName, Object level, boolean includeParentLevels, boolean resolveMacros) {
if (variableName == null || "".equals(variableName)) //$NON-NLS-1$ if (variableName == null || variableName.isEmpty())
return null; return null;
if (level instanceof IConfiguration) { if (level instanceof IConfiguration) {

View file

@ -1250,7 +1250,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
List<String> subDirList = new ArrayList<String>(); List<String> subDirList = new ArrayList<String>();
for (IContainer subDir : getSubdirList()) { for (IContainer subDir : getSubdirList()) {
IPath projectRelativePath = subDir.getProjectRelativePath(); IPath projectRelativePath = subDir.getProjectRelativePath();
if(!projectRelativePath.toString().equals("")) //$NON-NLS-1$ if(!projectRelativePath.toString().isEmpty())
subDirList.add(0, projectRelativePath.toString()); subDirList.add(0, projectRelativePath.toString());
} }
Collections.sort(subDirList, Collections.reverseOrder()); Collections.sort(subDirList, Collections.reverseOrder());
@ -4370,7 +4370,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
rcInfo = config.getResourceInfo(folderPath.removeLastSegments(1), false); rcInfo = config.getResourceInfo(folderPath.removeLastSegments(1), false);
} }
String targetExtension = ((IFolderInfo)rcInfo).getOutputExtension(srcExtension); String targetExtension = ((IFolderInfo)rcInfo).getOutputExtension(srcExtension);
if (!targetExtension.equals("")) //$NON-NLS-1$ if (!targetExtension.isEmpty())
fileName += DOT + targetExtension; fileName += DOT + targetExtension;
IPath projectRelativePath = deletedFile.getProjectRelativePath().removeLastSegments(1); IPath projectRelativePath = deletedFile.getProjectRelativePath().removeLastSegments(1);
IPath targetFilePath = getBuildWorkingDir().append(projectRelativePath).append(fileName); IPath targetFilePath = getBuildWorkingDir().append(projectRelativePath).append(fileName);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2012 Intel Corporation and others. * Copyright (c) 2005, 2016 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -1013,7 +1013,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
if (outExtensionName != null) { if (outExtensionName != null) {
OptDotExt = DOT + outExtensionName; OptDotExt = DOT + outExtensionName;
} else } else
if (!tool.getOutputExtension(srcExtensionName).equals("")) //$NON-NLS-1$ if (!tool.getOutputExtension(srcExtensionName).isEmpty())
OptDotExt = DOT + tool.getOutputExtension(srcExtensionName); OptDotExt = DOT + tool.getOutputExtension(srcExtensionName);
// create rule of the form // create rule of the form

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2010 Symbian Software Limited and others. * Copyright (c) 2007, 2016 Symbian Software Limited and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -84,7 +84,7 @@ public class AppendToMBSStringListOptionValues extends ProcessRunner {
private boolean setOptionValue(IProject projectHandle, String id, String[] value, String path) throws BuildException, ProcessFailureException { private boolean setOptionValue(IProject projectHandle, String id, String[] value, String path) throws BuildException, ProcessFailureException {
IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations(); IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations();
boolean resource = !(path == null || path.equals("") || path.equals("/")); //$NON-NLS-1$ //$NON-NLS-2$ boolean resource = !(path == null || path.isEmpty() || path.equals("/")); //$NON-NLS-1$
boolean modified = false; boolean modified = false;
for (IConfiguration config : projectConfigs) { for (IConfiguration config : projectConfigs) {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2010 Symbian Software Limited and others. * Copyright (c) 2007, 2016 Symbian Software Limited and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -83,7 +83,7 @@ public class AppendToMBSStringOptionValue extends ProcessRunner {
private boolean setOptionValue(IProject projectHandle, String id, String value, String path) throws BuildException, ProcessFailureException { private boolean setOptionValue(IProject projectHandle, String id, String value, String path) throws BuildException, ProcessFailureException {
IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations(); IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations();
boolean resource = !(path == null || path.equals("") || path.equals("/")); //$NON-NLS-1$ //$NON-NLS-2$ boolean resource = !(path == null || path.isEmpty() || path.equals("/")); //$NON-NLS-1$
boolean modified = false; boolean modified = false;
for (IConfiguration config : projectConfigs) { for (IConfiguration config : projectConfigs) {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2010 Symbian Software Limited and others. * Copyright (c) 2007, 2016 Symbian Software Limited and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -65,7 +65,7 @@ public class NewManagedProject extends ProcessRunner {
turnOffAutoBuild(workspace); turnOffAutoBuild(workspace);
IPath locationPath = null; IPath locationPath = null;
if (location != null && !location.trim().equals("")) { //$NON-NLS-1$ if (location != null && !location.trim().isEmpty()) {
locationPath = Path.fromPortableString(location); locationPath = Path.fromPortableString(location);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2010 Symbian Software Limited and others. * Copyright (c) 2007, 2016 Symbian Software Limited and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -79,7 +79,7 @@ public class SetMBSBooleanOptionValue extends ProcessRunner {
private boolean setOptionValue(IProject projectHandle, String id, String value, String path) throws BuildException, ProcessFailureException { private boolean setOptionValue(IProject projectHandle, String id, String value, String path) throws BuildException, ProcessFailureException {
IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations(); IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations();
boolean resource = !(path == null || path.equals("") || path.equals("/")); //$NON-NLS-1$ //$NON-NLS-2$ boolean resource = !(path == null || path.isEmpty() || path.equals("/")); //$NON-NLS-1$
boolean modified = false; boolean modified = false;
for (IConfiguration config : projectConfigs) { for (IConfiguration config : projectConfigs) {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2010 Symbian Software Limited and others. * Copyright (c) 2007, 2016 Symbian Software Limited and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -79,7 +79,7 @@ public class SetMBSStringListOptionValues extends ProcessRunner {
private boolean setOptionValue(IProject projectHandle, String id, String[] value, String path) throws BuildException, ProcessFailureException { private boolean setOptionValue(IProject projectHandle, String id, String[] value, String path) throws BuildException, ProcessFailureException {
IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations(); IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations();
boolean resource = !(path == null || path.equals("") || path.equals("/")); //$NON-NLS-1$ //$NON-NLS-2$ boolean resource = !(path == null || path.isEmpty() || path.equals("/")); //$NON-NLS-1$
boolean modified = false; boolean modified = false;
for (IConfiguration config : projectConfigs) { for (IConfiguration config : projectConfigs) {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -80,7 +80,7 @@ public class SetMBSStringOptionValue extends ProcessRunner {
private boolean setOptionValue(IProject projectHandle, String id, String value, String path) throws BuildException, ProcessFailureException { private boolean setOptionValue(IProject projectHandle, String id, String value, String path) throws BuildException, ProcessFailureException {
IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations(); IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations();
boolean resource = !(path == null || path.equals("") || path.equals("/")); //$NON-NLS-1$ //$NON-NLS-2$ boolean resource = !(path == null || path.isEmpty() || path.equals("/")); //$NON-NLS-1$
boolean modified = false; boolean modified = false;
for (IConfiguration config : projectConfigs) { for (IConfiguration config : projectConfigs) {

View file

@ -60,7 +60,7 @@ public class BuildOptionComboFieldEditor extends FieldEditor {
public BuildOptionComboFieldEditor(String name, String label, String tooltip, String contextId, String [] opts, String sel, Composite parent) { public BuildOptionComboFieldEditor(String name, String label, String tooltip, String contextId, String [] opts, String sel, Composite parent) {
this(name, label, opts, sel, parent); this(name, label, opts, sel, parent);
setToolTip(tooltip); setToolTip(tooltip);
if (!contextId.equals("")) PlatformUI.getWorkbench().getHelpSystem().setHelp(optionSelector, contextId); //$NON-NLS-1$ if (!contextId.isEmpty()) PlatformUI.getWorkbench().getHelpSystem().setHelp(optionSelector, contextId);
} }
/** /**

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -314,7 +314,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
optionValueExist = true; optionValueExist = true;
} }
} }
if (!enumeration.equals("")) //$NON-NLS-1$ if (!enumeration.isEmpty())
setOption(opt, enumeration); setOption(opt, enumeration);
break; break;
case IOption.TREE : case IOption.TREE :
@ -328,7 +328,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
optionValueExist = true; optionValueExist = true;
} }
} }
if (!selectedID.equals("")) //$NON-NLS-1$ if (!selectedID.isEmpty())
setOption(opt, selectedID); setOption(opt, selectedID);
break; break;
case IOption.STRING_LIST : case IOption.STRING_LIST :

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2011 BitMethods Inc and others. * Copyright (c) 2004, 2016 BitMethods Inc and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -89,7 +89,7 @@ public class FileListControlFieldEditor extends FieldEditor {
this(name, labelText, parent, type); this(name, labelText, parent, type);
// can't use setToolTip(tooltip) as label not created yet // can't use setToolTip(tooltip) as label not created yet
getLabelControl(parent).setToolTipText(tooltip); getLabelControl(parent).setToolTipText(tooltip);
if (!contextId.equals("")) PlatformUI.getWorkbench().getHelpSystem().setHelp(list.getListControl(), contextId); //$NON-NLS-1$ if (!contextId.isEmpty()) PlatformUI.getWorkbench().getHelpSystem().setHelp(list.getListControl(), contextId);
} }
/** /**
@ -299,7 +299,7 @@ public class FileListControlFieldEditor extends FieldEditor {
* @return * @return
*/ */
private String createList(String[] items) { private String createList(String[] items) {
StringBuffer path = new StringBuffer(""); //$NON-NLS-1$ StringBuffer path = new StringBuffer();
for (int i = 0; i < items.length; i++) { for (int i = 0; i < items.length; i++) {
path.append(items[i]); path.append(items[i]);

View file

@ -122,7 +122,7 @@ public class NewBuildConfigurationDialog extends Dialog {
for (int i = 0; i < definedCfgds.length; i++) { for (int i = 0; i < definedCfgds.length; i++) {
description = definedCfgds[i].getDescription(); description = definedCfgds[i].getDescription();
if( (description == null) || (description.equals("")) ){ //$NON-NLS-1$ if( (description == null) || (description.isEmpty()) ){
nameAndDescription = definedCfgds[i].getName(); nameAndDescription = definedCfgds[i].getName();
} else { } else {
nameAndDescription = definedCfgds[i].getName() + "( " + description + " )"; //$NON-NLS-1$ //$NON-NLS-2$ nameAndDescription = definedCfgds[i].getName() + "( " + description + " )"; //$NON-NLS-1$ //$NON-NLS-2$
@ -138,7 +138,7 @@ public class NewBuildConfigurationDialog extends Dialog {
for (int i = 0; i < defaultCfgds.length; i++) { for (int i = 0; i < defaultCfgds.length; i++) {
description = defaultCfgds[i].getDescription(); description = defaultCfgds[i].getDescription();
if( (description == null) || (description.equals("")) ) { //$NON-NLS-1$ if( (description == null) || (description.isEmpty()) ) {
nameAndDescription = defaultCfgds[i].getName(); nameAndDescription = defaultCfgds[i].getName();
} else { } else {
nameAndDescription = defaultCfgds[i].getName() + "( " + description + " )"; //$NON-NLS-1$ //$NON-NLS-2$ nameAndDescription = defaultCfgds[i].getName() + "( " + description + " )"; //$NON-NLS-1$ //$NON-NLS-2$
@ -330,7 +330,7 @@ public class NewBuildConfigurationDialog extends Dialog {
if(defaultCfgds.length != 0){ if(defaultCfgds.length != 0){
String namesAndDescriptions[] = new String[defaultCfgds.length]; String namesAndDescriptions[] = new String[defaultCfgds.length];
for (int i = 0; i < defaultCfgds.length; ++i) { for (int i = 0; i < defaultCfgds.length; ++i) {
if ( (defaultCfgds[i].getDescription() == null) || defaultCfgds[i].getDescription().equals("")) //$NON-NLS-1$ if ( (defaultCfgds[i].getDescription() == null) || defaultCfgds[i].getDescription().isEmpty())
namesAndDescriptions[i] = defaultCfgds[i].getName(); namesAndDescriptions[i] = defaultCfgds[i].getName();
else else
namesAndDescriptions[i] = defaultCfgds[i].getName() + "( " + defaultCfgds[i].getDescription() + " )"; //$NON-NLS-1$ //$NON-NLS-2$ namesAndDescriptions[i] = defaultCfgds[i].getName() + "( " + defaultCfgds[i].getDescription() + " )"; //$NON-NLS-1$ //$NON-NLS-2$
@ -362,7 +362,7 @@ public class NewBuildConfigurationDialog extends Dialog {
private String [] getDefinedConfigNamesAndDescriptions() { private String [] getDefinedConfigNamesAndDescriptions() {
String [] namesAndDescriptions = new String[definedCfgds.length]; String [] namesAndDescriptions = new String[definedCfgds.length];
for (int i = 0; i < definedCfgds.length; ++i) { for (int i = 0; i < definedCfgds.length; ++i) {
if ( (definedCfgds[i].getDescription() == null) || definedCfgds[i].getDescription().equals("")) //$NON-NLS-1$ if ( (definedCfgds[i].getDescription() == null) || definedCfgds[i].getDescription().isEmpty())
namesAndDescriptions[i] = definedCfgds[i].getName(); namesAndDescriptions[i] = definedCfgds[i].getName();
else else
namesAndDescriptions[i] = definedCfgds[i].getName() + "( " + definedCfgds[i].getDescription() +" )"; //$NON-NLS-1$ //$NON-NLS-2$ namesAndDescriptions[i] = definedCfgds[i].getName() + "( " + definedCfgds[i].getDescription() +" )"; //$NON-NLS-1$ //$NON-NLS-2$

View file

@ -481,7 +481,7 @@ public class NewCfgDialog implements INewCfgDialog {
private String getNameAndDescription(IConfiguration cfg) { private String getNameAndDescription(IConfiguration cfg) {
String name = cfg.getName(); String name = cfg.getName();
if (name == null) name = NULL; if (name == null) name = NULL;
if ( (cfg.getDescription() == null) || cfg.getDescription().equals("")) //$NON-NLS-1$ if ( (cfg.getDescription() == null) || cfg.getDescription().isEmpty())
return name; return name;
else else
return name + "( " + cfg.getDescription() +" )"; //$NON-NLS-1$ //$NON-NLS-2$ return name + "( " + cfg.getDescription() +" )"; //$NON-NLS-1$ //$NON-NLS-2$

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2010 QNX Software Systems and others. * Copyright (c) 2010, 2016 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -355,7 +355,7 @@ public class ControlFlowGraphView extends ViewPart {
} }
protected boolean open(String filename) throws PartInitException, CModelException { protected boolean open(String filename) throws PartInitException, CModelException {
if (filename.equals("")) if (filename.isEmpty())
return false; return false;
IResource r = ParserUtil.getResourceForFilename(filename); IResource r = ParserUtil.getResourceForFilename(filename);
if (r != null) { if (r != null) {

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -307,7 +307,7 @@ public class BinaryTests extends TestCase {
IBinary myBinary; IBinary myBinary;
String name; String name;
myBinary=CProjectHelper.findBinary(testProject, "test_g"); myBinary=CProjectHelper.findBinary(testProject, "test_g");
assertTrue(myBinary.getSoname().equals("")); assertTrue(myBinary.getSoname().isEmpty());
myBinary=CProjectHelper.findBinary(testProject, "libtestlib_g.so"); myBinary=CProjectHelper.findBinary(testProject, "libtestlib_g.so");
name=myBinary.getSoname(); name=myBinary.getSoname();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2001, 2012 IBM Corporation and others. * Copyright (c) 2001, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -120,7 +120,7 @@ public abstract class AutomatedFramework extends TestCase {
suite.addTest( newTest( "propertiesFailed") ); //$NON-NLS-1$ suite.addTest( newTest( "propertiesFailed") ); //$NON-NLS-1$
} }
if( outputFile != null && !outputFile.equals("") ){ //$NON-NLS-1$ if( outputFile != null && !outputFile.isEmpty() ){
try{ try{
File output = new File( outputFile ); File output = new File( outputFile );

View file

@ -185,7 +185,7 @@ public class BTreeTests extends BaseTestCase {
public void assertBTreeInvariantsHold(String msg) throws CoreException { public void assertBTreeInvariantsHold(String msg) throws CoreException {
String errorReport = btree.getInvariantsErrorReport(); String errorReport = btree.getInvariantsErrorReport();
if (!errorReport.equals("")) { if (!errorReport.isEmpty()) {
fail("Invariants do not hold: " + errorReport); fail("Invariants do not hold: " + errorReport);
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2014 IBM Corporation and others. * Copyright (c) 2005, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -178,13 +178,13 @@ public class Main {
* @param prop the initial comma-separated string * @param prop the initial comma-separated string
*/ */
private String[] getArrayFromList(String prop) { private String[] getArrayFromList(String prop) {
if (prop == null || prop.trim().equals("")) if (prop == null || prop.trim().isEmpty())
return new String[0]; return new String[0];
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
StringTokenizer tokens = new StringTokenizer(prop, ","); StringTokenizer tokens = new StringTokenizer(prop, ",");
while (tokens.hasMoreTokens()) { while (tokens.hasMoreTokens()) {
String token = tokens.nextToken().trim(); String token = tokens.nextToken().trim();
if (!token.equals("")) if (!token.isEmpty())
list.add(token); list.add(token);
} }
return list.toArray(new String[list.size()]); return list.toArray(new String[list.size()]);

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -548,7 +548,7 @@ public class GCCBuiltinSymbolProvider implements IBuiltinBindingsProvider {
if (tstr.equals("void")) { if (tstr.equals("void")) {
Kind kind = Kind.eVoid; Kind kind = Kind.eVoid;
t = fCpp ? new CPPBasicType(kind, q) : new CBasicType(kind, q); t = fCpp ? new CPPBasicType(kind, q) : new CBasicType(kind, q);
} else if (tstr.equals("")) { } else if (tstr.isEmpty()) {
Kind kind = Kind.eUnspecified; Kind kind = Kind.eUnspecified;
t = fCpp ? new CPPBasicType(kind, q) : new CBasicType(kind, q); t = fCpp ? new CPPBasicType(kind, q) : new CBasicType(kind, q);
} else if (tstr.equals("char")) { } else if (tstr.equals("char")) {

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -240,7 +240,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
} }
names = names + name; names = names + name;
} }
if (names.equals("")) { if (names.isEmpty()) {
return strIds; return strIds;
} }
return names; return names;

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -133,7 +133,7 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
// if(contextType != DefaultMacroContextInfo.CONTEXT_WORKSPACE) // if(contextType != DefaultMacroContextInfo.CONTEXT_WORKSPACE)
// return null; // return null;
if(macroName == null || "".equals(macroName)) //$NON-NLS-1$ if(macroName == null || macroName.isEmpty())
return null; return null;
String varName = null; String varName = null;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2009 Intel Corporation and others. * Copyright (c) 2005, 2016 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -101,7 +101,7 @@ public class EnvironmentVariableSupplier extends CoreMacroSupplierBase {
} }
private static boolean isTextList(String str, String delimiter) { private static boolean isTextList(String str, String delimiter) {
if (delimiter == null || "".equals(delimiter)) //$NON-NLS-1$ if (delimiter == null || delimiter.isEmpty())
return false; return false;
// Regex: ([^:]+:)+[^:]* // Regex: ([^:]+:)+[^:]*
@ -127,7 +127,7 @@ public class EnvironmentVariableSupplier extends CoreMacroSupplierBase {
@Override @Override
public ICdtVariable getMacro(String macroName, int contextType, public ICdtVariable getMacro(String macroName, int contextType,
Object contextData) { Object contextData) {
if(macroName == null || "".equals(macroName)) //$NON-NLS-1$ if(macroName == null || macroName.isEmpty())
return null; return null;
IEnvironmentVariable var = null; IEnvironmentVariable var = null;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2015 Intel Corporation and others. * Copyright (c) 2005, 2016 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -113,7 +113,7 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase {
*/ */
@Override @Override
public ICdtVariable getMacro(String macroName, int contextType, Object contextData) { public ICdtVariable getMacro(String macroName, int contextType, Object contextData) {
if(macroName == null || "".equals(macroName)) //$NON-NLS-1$ if(macroName == null || macroName.isEmpty())
return null; return null;
StorableCdtVariables macros = getStorableMacros(contextType,contextData); StorableCdtVariables macros = getStorableMacros(contextType,contextData);
@ -138,7 +138,7 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase {
String value, String value,
int contextType, int contextType,
Object contextData){ Object contextData){
if(macroName == null || "".equals(macroName)) //$NON-NLS-1$ if(macroName == null || macroName.isEmpty())
return null; return null;
StorableCdtVariables macros = getStorableMacros(contextType, contextData); StorableCdtVariables macros = getStorableMacros(contextType, contextData);
if(macros == null) if(macros == null)
@ -168,7 +168,7 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase {
String value[], String value[],
int contextType, int contextType,
Object contextData){ Object contextData){
if(macroName == null || "".equals(macroName)) //$NON-NLS-1$ if(macroName == null || macroName.isEmpty())
return null; return null;
StorableCdtVariables macros = getStorableMacros(contextType, contextData); StorableCdtVariables macros = getStorableMacros(contextType, contextData);
if(macros == null) if(macros == null)
@ -197,7 +197,7 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase {
if(copy == null) if(copy == null)
return null; return null;
String macroName = copy.getName(); String macroName = copy.getName();
if(macroName == null || "".equals(macroName)) //$NON-NLS-1$ if(macroName == null || macroName.isEmpty())
return null; return null;
StorableCdtVariables macros = getStorableMacros(contextType, contextData); StorableCdtVariables macros = getStorableMacros(contextType, contextData);
if(macros == null) if(macros == null)

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2012 Intel Corporation and others. * Copyright (c) 2005, 2016 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -179,7 +179,7 @@ public class EnvironmentVariableManager implements IEnvironmentVariableManager {
@Override @Override
public IEnvironmentVariable getVariable(String variableName, ICConfigurationDescription cfg, boolean resolveMacros) { public IEnvironmentVariable getVariable(String variableName, ICConfigurationDescription cfg, boolean resolveMacros) {
if (variableName == null || "".equals(variableName)) //$NON-NLS-1$ if (variableName == null || variableName.isEmpty())
return null; return null;
IEnvironmentContextInfo info = getContextInfo(cfg); IEnvironmentContextInfo info = getContextInfo(cfg);
@ -193,7 +193,7 @@ public class EnvironmentVariableManager implements IEnvironmentVariableManager {
@Override @Override
public IEnvironmentVariable getVariable(String name, IBuildConfiguration config, boolean resolveMacros) { public IEnvironmentVariable getVariable(String name, IBuildConfiguration config, boolean resolveMacros) {
if (name == null || "".equals(name)) //$NON-NLS-1$ if (name == null || name.isEmpty())
return null; return null;
IEnvironmentContextInfo info = getContextInfo(config); IEnvironmentContextInfo info = getContextInfo(config);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2008 Symbian Software Limited and others. * Copyright (c) 2007, 2016 Symbian Software Limited and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -135,7 +135,7 @@ public class SharedDefaults extends HashMap<String, String> {
Element xmlElement = sharedElementList.get(i); Element xmlElement = sharedElementList.get(i);
key = xmlElement.getAttribute(TemplateEngineHelper.ID); key = xmlElement.getAttribute(TemplateEngineHelper.ID);
value = xmlElement.getAttribute(TemplateEngineHelper.VALUE); value = xmlElement.getAttribute(TemplateEngineHelper.VALUE);
if (key != null && !key.trim().equals("")) { //$NON-NLS-1$ if (key != null && !key.trim().isEmpty()) {
sharedDefaultsMap.put(key, value); sharedDefaultsMap.put(key, value);
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2014 Symbian Software Limited and others. * Copyright (c) 2007, 2016 Symbian Software Limited and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -176,7 +176,7 @@ public class TemplateDescriptor {
Element propertyElement = children.get(i); Element propertyElement = children.get(i);
String key = propertyElement.getAttribute(ID); String key = propertyElement.getAttribute(ID);
String value = propertyElement.getAttribute(DEFAULT); String value = propertyElement.getAttribute(DEFAULT);
if (key != null && !key.equals("")) { //$NON-NLS-1$ if (key != null && !key.isEmpty()) {
defaults.put(key, value); defaults.put(key, value);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2014 Symbian Software Limited and others. * Copyright (c) 2007, 2016 Symbian Software Limited and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -75,7 +75,7 @@ public class ConditionalProcessGroup {
this.id = "Condition " + id; //$NON-NLS-1$ this.id = "Condition " + id; //$NON-NLS-1$
conditionString = conditionElement.getAttribute(ProcessHelper.CONDITION); conditionString = conditionElement.getAttribute(ProcessHelper.CONDITION);
if (conditionString != null) { if (conditionString != null) {
if (conditionString.trim().equals("")) { //$NON-NLS-1$ if (conditionString.trim().isEmpty()) {
conditionString = null; conditionString = null;
} else { } else {
int op = conditionString.indexOf(ProcessHelper.EQUALS); int op = conditionString.indexOf(ProcessHelper.EQUALS);

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -109,7 +109,7 @@ public class CygPath {
reader = new BufferedReader(new InputStreamReader(cygPath.getInputStream())); reader = new BufferedReader(new InputStreamReader(cygPath.getInputStream()));
String newPath = reader.readLine(); String newPath = reader.readLine();
IPath ipath; IPath ipath;
if (path != null && !path.equals("")) { //$NON-NLS-1$ if (path != null && !path.isEmpty()) {
ipath = new Path(newPath); ipath = new Path(newPath);
} else { } else {
ipath = new Path(path); ipath = new Path(path);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2015 Intel Corporation and others. * Copyright (c) 2005, 2016 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -83,7 +83,7 @@ public class EnvVarOperationProcessor {
if(addValue == null) if(addValue == null)
return initialValue; return initialValue;
if(delimiter == null || "".equals(delimiter)){ //$NON-NLS-1$ if(delimiter == null || delimiter.isEmpty()){
return prepend ? addValue + initialValue : initialValue + addValue; return prepend ? addValue + initialValue : initialValue + addValue;
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2012 IBM Corporation and others. * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -169,13 +169,13 @@ protected Object basicRun(String[] args) throws Exception {
* @param prop the initial comma-separated string * @param prop the initial comma-separated string
*/ */
private String[] getArrayFromList(String prop) { private String[] getArrayFromList(String prop) {
if (prop == null || prop.trim().equals("")) //$NON-NLS-1$ if (prop == null || prop.trim().isEmpty())
return new String[0]; return new String[0];
Vector list = new Vector(); Vector list = new Vector();
StringTokenizer tokens = new StringTokenizer(prop, ","); //$NON-NLS-1$ StringTokenizer tokens = new StringTokenizer(prop, ","); //$NON-NLS-1$
while (tokens.hasMoreTokens()) { while (tokens.hasMoreTokens()) {
String token = tokens.nextToken().trim(); String token = tokens.nextToken().trim();
if (!token.equals("")) //$NON-NLS-1$ if (!token.isEmpty())
list.addElement(token); list.addElement(token);
} }
return list.isEmpty() ? new String[0] : (String[]) list.toArray(new String[0]); return list.isEmpty() ? new String[0] : (String[]) list.toArray(new String[0]);

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -344,7 +344,7 @@ public class Strings {
private static int findLastNonEmptyLineIndex(String[] sourceLines) { private static int findLastNonEmptyLineIndex(String[] sourceLines) {
for (int i= sourceLines.length - 1; i >= 0; i--) { for (int i= sourceLines.length - 1; i >= 0; i--) {
if (! sourceLines[i].trim().equals(""))//$NON-NLS-1$ if (! sourceLines[i].trim().isEmpty())
return i; return i;
} }
return -1; return -1;

View file

@ -477,7 +477,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
} }
String wsname = memento.getString(TAG_WORKINGSET); String wsname = memento.getString(TAG_WORKINGSET);
if (wsname != null && wsname.equals("") == false) { //$NON-NLS-1$ if (wsname != null && !wsname.isEmpty()) {
IWorkingSetManager wsmanager = getViewSite().getWorkbenchWindow().getWorkbench().getWorkingSetManager(); IWorkingSetManager wsmanager = getViewSite().getWorkbenchWindow().getWorkbench().getWorkingSetManager();
IWorkingSet workingSet = wsmanager.getWorkingSet(wsname); IWorkingSet workingSet = wsmanager.getWorkingSet(wsname);
if (workingSet != null) { if (workingSet != null) {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2012 QNX Software Systems and others. * Copyright (c) 2004, 2016 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -910,7 +910,7 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage
String newItem = null; String newItem = null;
if (dialog.open() == Window.OK) { if (dialog.open() == Window.OK) {
newItem = dialog.getValue(); newItem = dialog.getValue();
if (newItem != null && !newItem.equals("")) { //$NON-NLS-1$ if (newItem != null && !newItem.isEmpty()) {
if (existing == null) { if (existing == null) {
CPElementGroup group = getSelectedGroup(); CPElementGroup group = getSelectedGroup();
CPElement newPath = new CPElement(fCurrCProject, IPathEntry.CDT_INCLUDE, group.getResource().getFullPath(), CPElement newPath = new CPElement(fCurrCProject, IPathEntry.CDT_INCLUDE, group.getResource().getFullPath(),

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -968,7 +968,7 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
String newItem = null; String newItem = null;
if (dialog.open() == Window.OK) { if (dialog.open() == Window.OK) {
newItem = dialog.getValue(); newItem = dialog.getValue();
if (newItem != null && !newItem.equals("")) { //$NON-NLS-1$ if (newItem != null && !newItem.isEmpty()) {
if (existing == null) { if (existing == null) {
CPElementGroup group = getSelectedGroup(); CPElementGroup group = getSelectedGroup();
CPElement newPath = new CPElement(fCurrCProject, IPathEntry.CDT_INCLUDE, group.getResource().getFullPath(), CPElement newPath = new CPElement(fCurrCProject, IPathEntry.CDT_INCLUDE, group.getResource().getFullPath(),

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -51,7 +51,7 @@ public class Checks {
public static boolean startsWithUpperCase(String s) { public static boolean startsWithUpperCase(String s) {
if (s == null) { if (s == null) {
return false; return false;
} else if ("".equals(s)) { //$NON-NLS-1$ } else if (s.isEmpty()) {
return false; return false;
} else { } else {
// Workaround for JDK bug (see 26529) // Workaround for JDK bug (see 26529)
@ -62,7 +62,7 @@ public class Checks {
public static boolean startsWithLowerCase(String s){ public static boolean startsWithLowerCase(String s){
if (s == null) { if (s == null) {
return false; return false;
} else if ("".equals(s)) { //$NON-NLS-1$ } else if (s.isEmpty()) {
return false; return false;
} else { } else {
// Workaround for JDK bug (see 26529) // Workaround for JDK bug (see 26529)

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -66,7 +66,7 @@ public class CHelpProviderDescriptor {
private Element getDescriptorElement(Element parentElement){ private Element getDescriptorElement(Element parentElement){
String id = getConfigurationElement().getAttribute(ATTRIBUTE_ID); String id = getConfigurationElement().getAttribute(ATTRIBUTE_ID);
if(id == null || "".equals(id)) //$NON-NLS-1$ if(id == null || id.isEmpty())
return null; return null;
NodeList nodes = parentElement.getElementsByTagName(ELEMENT_PROVIDER); NodeList nodes = parentElement.getElementsByTagName(ELEMENT_PROVIDER);
@ -88,7 +88,7 @@ public class CHelpProviderDescriptor {
private static ICHelpProvider getCHelpProvider(IConfigurationElement element){ private static ICHelpProvider getCHelpProvider(IConfigurationElement element){
String id = element.getAttribute(ATTRIBUTE_ID); String id = element.getAttribute(ATTRIBUTE_ID);
if(id == null || "".equals(id)) //$NON-NLS-1$ if(id == null || id.isEmpty())
return null; return null;
Map<String, ICHelpProvider> providersMap = getProvidersMap(); Map<String, ICHelpProvider> providersMap = getProvidersMap();
@ -168,7 +168,7 @@ public class CHelpProviderDescriptor {
public void serialize(Document doc, Element parentElement){ public void serialize(Document doc, Element parentElement){
String id = getConfigurationElement().getAttribute(ATTRIBUTE_ID); String id = getConfigurationElement().getAttribute(ATTRIBUTE_ID);
if(id == null || "".equals(id)) //$NON-NLS-1$ if(id == null || id.isEmpty())
return; return;
CHelpBookDescriptor bookDescriptors[] = getCHelpBookDescriptors(); CHelpBookDescriptor bookDescriptors[] = getCHelpBookDescriptors();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2014 IBM Corporation and others. * Copyright (c) 2005, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -132,7 +132,7 @@ public class DialogField {
fLabel= new Label(parent, SWT.LEFT); fLabel= new Label(parent, SWT.LEFT);
fLabel.setFont(parent.getFont()); fLabel.setFont(parent.getFont());
fLabel.setEnabled(fEnabled); fLabel.setEnabled(fEnabled);
if (fLabelText != null && !"".equals(fLabelText)) { //$NON-NLS-1$ if (fLabelText != null && !fLabelText.isEmpty()) {
fLabel.setText(fLabelText); fLabel.setText(fLabelText);
} else { } else {
// XXX: to avoid a 16 pixel wide empty label - revisit // XXX: to avoid a 16 pixel wide empty label - revisit

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -420,7 +420,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag
if (newText.equals(newText.trim()) == false) { if (newText.equals(newText.trim()) == false) {
errorMessage = WorkingSetMessages.CElementWorkingSetPage_warning_nameMustNotBeEmpty; errorMessage = WorkingSetMessages.CElementWorkingSetPage_warning_nameMustNotBeEmpty;
} }
if (newText.equals("")) { //$NON-NLS-1$ if (newText.isEmpty()) {
if (fFirstCheck) { if (fFirstCheck) {
setPageComplete(false); setPageComplete(false);
fFirstCheck= false; fFirstCheck= false;

View file

@ -96,7 +96,7 @@ public class NewConfigurationDialog extends Dialog implements INewCfgDialog {
for (int i = 0; i < cfgds.length; i++) { for (int i = 0; i < cfgds.length; i++) {
description = cfgds[i].getDescription(); description = cfgds[i].getDescription();
if( (description == null) || (description.equals("")) ){ //$NON-NLS-1$ if( (description == null) || (description.isEmpty()) ){
nameAndDescription = cfgds[i].getName(); nameAndDescription = cfgds[i].getName();
} else { } else {
nameAndDescription = cfgds[i].getName() + "( " + description + " )"; //$NON-NLS-1$ //$NON-NLS-2$ nameAndDescription = cfgds[i].getName() + "( " + description + " )"; //$NON-NLS-1$ //$NON-NLS-2$
@ -250,7 +250,7 @@ public class NewConfigurationDialog extends Dialog implements INewCfgDialog {
private String [] getDefinedConfigNamesAndDescriptions() { private String [] getDefinedConfigNamesAndDescriptions() {
String [] namesAndDescriptions = new String[cfgds.length]; String [] namesAndDescriptions = new String[cfgds.length];
for (int i = 0; i < cfgds.length; ++i) { for (int i = 0; i < cfgds.length; ++i) {
if ( (cfgds[i].getDescription() == null) || cfgds[i].getDescription().equals("")) //$NON-NLS-1$ if ( (cfgds[i].getDescription() == null) || cfgds[i].getDescription().isEmpty())
namesAndDescriptions[i] = cfgds[i].getName(); namesAndDescriptions[i] = cfgds[i].getName();
else else
namesAndDescriptions[i] = cfgds[i].getName() + "( " + cfgds[i].getDescription() +" )"; //$NON-NLS-1$ //$NON-NLS-2$ namesAndDescriptions[i] = cfgds[i].getName() + "( " + cfgds[i].getDescription() +" )"; //$NON-NLS-1$ //$NON-NLS-2$

View file

@ -221,7 +221,7 @@ public class UITextWidget extends InputUIElement implements ModifyListener {
return; return;
String mandatory = uiAttributes.get(InputUIElement.MANDATORY); String mandatory = uiAttributes.get(InputUIElement.MANDATORY);
if ((mandatory == null || !mandatory.equalsIgnoreCase("true")) && textValue.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$ if ((mandatory == null || !mandatory.equalsIgnoreCase("true")) && textValue.isEmpty()) { //$NON-NLS-1$
return; return;
} }
@ -264,7 +264,7 @@ public class UITextWidget extends InputUIElement implements ModifyListener {
String mandatory = uiAttributes.get(InputUIElement.MANDATORY); String mandatory = uiAttributes.get(InputUIElement.MANDATORY);
if (((mandatory != null) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) if (((mandatory != null) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE)))
&& ((textValue == null) || (textValue.equals("")) || //$NON-NLS-1$ && ((textValue == null) || (textValue.isEmpty()) ||
(textValue.trim().length() < 1))) { (textValue.trim().length() < 1))) {
retVal = false; retVal = false;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2015 BitMethods Inc and others. * Copyright (c) 2004, 2016 BitMethods Inc and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -432,7 +432,7 @@ public class FileListControl {
int i = getSelectionIndex(); int i = getSelectionIndex();
// insert items at the correct location // insert items at the correct location
for (String item : pasteBuffer) for (String item : pasteBuffer)
if (!item.trim().equals("")) //$NON-NLS-1$ if (!item.trim().isEmpty())
add(item.trim(), ++i); add(item.trim(), ++i);
checkNotificationNeeded(); checkNotificationNeeded();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2009, 2015 MontaVista Software, Inc. and others. * Copyright (c) 2009, 2016 MontaVista Software, Inc. and others.
* This program and the accompanying materials are made available under the terms * 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 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -249,7 +249,7 @@ public class RSEHelper {
String remoteCommand = realRemoteCommand + CMD_DELIMITER + EXIT_CMD; String remoteCommand = realRemoteCommand + CMD_DELIMITER + EXIT_CMD;
if (!prelaunchCmd.trim().equals("")) //$NON-NLS-1$ if (!prelaunchCmd.trim().isEmpty())
remoteCommand = prelaunchCmd + CMD_DELIMITER + remoteCommand; remoteCommand = prelaunchCmd + CMD_DELIMITER + remoteCommand;
IShellService shellService; IShellService shellService;
@ -299,7 +299,7 @@ public class RSEHelper {
String remoteCommand = realRemoteCommand + CMD_DELIMITER + EXIT_CMD; String remoteCommand = realRemoteCommand + CMD_DELIMITER + EXIT_CMD;
if (!prelaunchCmd.trim().equals("")) //$NON-NLS-1$ if (!prelaunchCmd.trim().isEmpty())
remoteCommand = prelaunchCmd + CMD_DELIMITER + remoteCommand; remoteCommand = prelaunchCmd + CMD_DELIMITER + remoteCommand;
IShellService shellService = null; IShellService shellService = null;

View file

@ -95,7 +95,7 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS, IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS,
""); //$NON-NLS-1$ ""); //$NON-NLS-1$
if (arguments != null && !arguments.equals("")) //$NON-NLS-1$ if (arguments != null && !arguments.isEmpty())
commandArguments += " " + arguments; //$NON-NLS-1$ commandArguments += " " + arguments; //$NON-NLS-1$
monitor.setTaskName(Messages.RemoteRunLaunchDelegate_9); monitor.setTaskName(Messages.RemoteRunLaunchDelegate_9);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2015 PalmSource, Inc. and others. * Copyright (c) 2006, 2016 PalmSource, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -146,7 +146,7 @@ public class RemoteCDSFMainTab extends CMainTab {
int currentSelection = connectionCombo.getSelectionIndex(); int currentSelection = connectionCombo.getSelectionIndex();
String connection_name = currentSelection >= 0 ? connectionCombo String connection_name = currentSelection >= 0 ? connectionCombo
.getItem(currentSelection) : ""; //$NON-NLS-1$ .getItem(currentSelection) : ""; //$NON-NLS-1$
if (connection_name.equals("")) { //$NON-NLS-1$ if (connection_name.isEmpty()) {
setErrorMessage(CONNECTION_TEXT_ERROR); setErrorMessage(CONNECTION_TEXT_ERROR);
retVal = false; retVal = false;
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013, 2015 Red Hat, Inc. * Copyright (c) 2013, 2016 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -242,7 +242,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
} }
}); });
// Check and see if we failed above and if so, quit // Check and see if we failed above and if so, quit
if (info.getHostPath().equals("")) { //$NON-NLS-1$ if (info.getHostPath().isEmpty()) {
monitor.done(); monitor.done();
// throw internal exception which will be caught below // throw internal exception which will be caught below
throw new StartupException(errorStatus.getMessage()); throw new StartupException(errorStatus.getMessage());
@ -342,7 +342,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
} }
}); });
// Check and see if we failed above and if so, quit // Check and see if we failed above and if so, quit
if (info.getHostPath().equals("")) { //$NON-NLS-1$ if (info.getHostPath().isEmpty()) {
monitor.done(); monitor.done();
// throw internal exception which will be caught below // throw internal exception which will be caught below
throw new StartupException(errorStatus.getMessage()); throw new StartupException(errorStatus.getMessage());
@ -405,7 +405,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
} }
}); });
// Check and see if we failed above and if so, quit // Check and see if we failed above and if so, quit
if (info.getHostPath().equals("")) { //$NON-NLS-1$ if (info.getHostPath().isEmpty()) {
monitor.done(); monitor.done();
// throw internal exception which will be caught below // throw internal exception which will be caught below
throw new StartupException(errorStatus.getMessage()); throw new StartupException(errorStatus.getMessage());

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2015 QNX Software Systems and others. * Copyright (c) 2004, 2016 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -630,7 +630,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement
} }
} }
String filename = getPreferenceStore().getString(ICBreakpoint.SOURCE_HANDLE); String filename = getPreferenceStore().getString(ICBreakpoint.SOURCE_HANDLE);
if (filename != null && !"".equals(filename)) { //$NON-NLS-1$ if (filename != null && !filename.isEmpty()) {
addField( createLabelEditor( getFieldEditorParent(), BreakpointsMessages.getString( "CBreakpointPropertyPage.sourceHandle_label" ), filename ) ); //$NON-NLS-1$ addField( createLabelEditor( getFieldEditorParent(), BreakpointsMessages.getString( "CBreakpointPropertyPage.sourceHandle_label" ), filename ) ); //$NON-NLS-1$
} }
createWatchExpressionEditor(getFieldEditorParent()); createWatchExpressionEditor(getFieldEditorParent());

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2014 IBM Corporation and others. * Copyright (c) 2005, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -141,7 +141,7 @@ public class DialogField {
fLabel= new Label(parent, SWT.LEFT | SWT.WRAP); fLabel= new Label(parent, SWT.LEFT | SWT.WRAP);
fLabel.setFont(parent.getFont()); fLabel.setFont(parent.getFont());
fLabel.setEnabled(fEnabled); fLabel.setEnabled(fEnabled);
if (fLabelText != null && !"".equals(fLabelText)) { //$NON-NLS-1$ if (fLabelText != null && !fLabelText.isEmpty()) {
fLabel.setText(fLabelText); fLabel.setText(fLabelText);
} else { } else {
// XXX: to avoid a 16 pixel wide empty label - revisit // XXX: to avoid a 16 pixel wide empty label - revisit

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2015 Ericsson and others. * Copyright (c) 2015, 2016 Ericsson and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -491,6 +491,6 @@ public class PersistentSettingsManager {
/** Returns the key to be used to save parameter, taking into account the /** Returns the key to be used to save parameter, taking into account the
* instance id, if applicable */ * instance id, if applicable */
private String getStorageKey(boolean perInstance) { private String getStorageKey(boolean perInstance) {
return (perInstance ? m_instance : "") + (!m_category.equals("") ? "." + m_category : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ return (perInstance ? m_instance : "") + (!m_category.isEmpty() ? "." + m_category : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2008, 2013 QNX Software Systems and others. * Copyright (c) 2008, 2016 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -138,9 +138,9 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
protected void initDebuggerTypes(String selection) { protected void initDebuggerTypes(String selection) {
if (fAttachMode) { if (fAttachMode) {
setInitializeDefault(selection.equals("") ? true : false); //$NON-NLS-1$ setInitializeDefault(selection.isEmpty());
if (selection.equals("")) { //$NON-NLS-1$ if (selection.isEmpty()) {
selection = LOCAL_DEBUGGER_ID; selection = LOCAL_DEBUGGER_ID;
} }
@ -623,4 +623,4 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
return fDCombo.getItem(selectedIndex); return fDCombo.getItem(selectedIndex);
} }
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2008, 2012 QNX Software Systems and others. * Copyright (c) 2008, 2016 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -60,7 +60,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
} catch (CoreException e) { } catch (CoreException e) {
} }
if (projectName != null && !projectName.equals("")) { //$NON-NLS-1$ if (projectName != null && !projectName.isEmpty()) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project); ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project);
if (cProject != null && cProject.exists()) { if (cProject != null && cProject.exists()) {
@ -101,7 +101,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
} }
} }
if (obj != null) { if (obj != null) {
if (programName == null || programName.equals("")) { //$NON-NLS-1$ if (programName == null || programName.isEmpty()) {
return (ICElement)obj; return (ICElement)obj;
} }
ICElement ce = (ICElement)obj; ICElement ce = (ICElement)obj;

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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -170,7 +170,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
DirectoryDialog dialog = new DirectoryDialog(getShell()); DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setMessage(LaunchUIMessages.getString("WorkingDirectoryBlock.7")); //$NON-NLS-1$ dialog.setMessage(LaunchUIMessages.getString("WorkingDirectoryBlock.7")); //$NON-NLS-1$
String currentWorkingDir = fWorkingDirText.getText(); String currentWorkingDir = fWorkingDirText.getText();
if (!currentWorkingDir.trim().equals("")) { //$NON-NLS-1$ if (!currentWorkingDir.trim().isEmpty()) {
File path = new File(currentWorkingDir); File path = new File(currentWorkingDir);
if (path.exists()) { if (path.exists()) {
dialog.setFilterPath(currentWorkingDir); dialog.setFilterPath(currentWorkingDir);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2010 Wind River Systems and others. * Copyright (c) 2010, 2016 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -49,7 +49,7 @@ public abstract class AbstractImageRegistry extends ImageRegistry {
* key. * key.
*/ */
protected void localImage(String key, String dir, String name) { protected void localImage(String key, String dir, String name) {
if (dir== null || dir.equals(""))//$NON-NLS-1$ if (dir== null || dir.isEmpty())
fLocations.put(key, new String[] {"icons/" + name}); //$NON-NLS-1$ fLocations.put(key, new String[] {"icons/" + name}); //$NON-NLS-1$
else else
fLocations.put(key, new String[] {"icons/" + dir + "/" + name}); //$NON-NLS-1$ //$NON-NLS-2$ fLocations.put(key, new String[] {"icons/" + dir + "/" + name}); //$NON-NLS-1$ //$NON-NLS-2$
@ -72,7 +72,7 @@ public abstract class AbstractImageRegistry extends ImageRegistry {
String[] locations = new String[dirs.length]; String[] locations = new String[dirs.length];
for (int i = 0; i < dirs.length; i++) { for (int i = 0; i < dirs.length; i++) {
String dir = dirs[i]; String dir = dirs[i];
if (dir== null || dir.equals(""))//$NON-NLS-1$ if (dir== null || dir.isEmpty())
locations[i] = "icons/" + name; //$NON-NLS-1$ locations[i] = "icons/" + name; //$NON-NLS-1$
else else
locations[i] = "icons/" + dir + "/" + name; //$NON-NLS-1$ //$NON-NLS-2$ locations[i] = "icons/" + dir + "/" + name; //$NON-NLS-1$ //$NON-NLS-2$

View file

@ -1421,7 +1421,7 @@ public class GDBProcesses_7_0 extends AbstractDsfService
List<IMIContainerDMContext> containerDmcs = new ArrayList<IMIContainerDMContext>(groups.length); List<IMIContainerDMContext> containerDmcs = new ArrayList<IMIContainerDMContext>(groups.length);
for (IThreadGroupInfo group : groups) { for (IThreadGroupInfo group : groups) {
if (group.getPid() == null || if (group.getPid() == null ||
group.getPid().equals("") || group.getPid().equals("0")) { //$NON-NLS-1$ //$NON-NLS-2$ group.getPid().isEmpty() || group.getPid().equals("0")) { //$NON-NLS-1$
continue; continue;
} }
String groupId = group.getGroupId(); String groupId = group.getGroupId();

View file

@ -222,7 +222,7 @@ public class MIBreakpointDMData implements IBreakpointDMData {
Integer lineNumber = fBreakpoint.getLine(); Integer lineNumber = fBreakpoint.getLine();
String function = fBreakpoint.getFunction(); String function = fBreakpoint.getFunction();
if (!fileName.equals("")) { //$NON-NLS-1$ if (!fileName.isEmpty()) {
if (lineNumber != -1) { if (lineNumber != -1) {
location = fileName + ":" + lineNumber; //$NON-NLS-1$ location = fileName + ":" + lineNumber; //$NON-NLS-1$
} else { } else {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2008, 2015 Ericsson and others. * Copyright (c) 2008, 2016 Ericsson and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -450,7 +450,7 @@ public class MIListThreadGroupsInfo extends MIInfo {
// a description, that only happens for -list-thread-groups --available // a description, that only happens for -list-thread-groups --available
// We must check this because with GDB 7.2, there will be no pid field as a result // We must check this because with GDB 7.2, there will be no pid field as a result
// of -list-thread-groups, if no process is actually running yet. // of -list-thread-groups, if no process is actually running yet.
if (pid.equals("") && !desc.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$ if (pid.isEmpty() && !desc.isEmpty()) {
pid = id; pid = id;
} }
fGroupList[i] = new ThreadGroupInfo(id, desc, type, pid, user, cores, exec, threads, exitCode); fGroupList[i] = new ThreadGroupInfo(id, desc, type, pid, user, cores, exec, threads, exitCode);

View file

@ -1823,7 +1823,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase {
// Verify the state of the breakpoint // Verify the state of the breakpoint
MIBreakpointDMData breakpoint2 = (MIBreakpointDMData) getBreakpoint(ref); MIBreakpointDMData breakpoint2 = (MIBreakpointDMData) getBreakpoint(ref);
assertTrue("BreakpointEvent problem: breakpoint mismatch (wrong condition)", assertTrue("BreakpointEvent problem: breakpoint mismatch (wrong condition)",
breakpoint2.getCondition().equals("")); breakpoint2.getCondition().isEmpty());
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -2010,7 +2010,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase {
// Verify the state of the watchpoint // Verify the state of the watchpoint
MIBreakpointDMData watchpoint2 = (MIBreakpointDMData) getBreakpoint(ref); MIBreakpointDMData watchpoint2 = (MIBreakpointDMData) getBreakpoint(ref);
assertTrue("BreakpointEvent problem: breakpoint mismatch (wrong condition)", assertTrue("BreakpointEvent problem: breakpoint mismatch (wrong condition)",
watchpoint2.getCondition().equals("")); watchpoint2.getCondition().isEmpty());
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -3246,7 +3246,7 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase {
// Ensure that the breakpoint was correctly installed // Ensure that the breakpoint was correctly installed
MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref); MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref);
assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)",
breakpoint1.getFileName().equals("")); breakpoint1.getFileName().isEmpty());
assertTrue("BreakpointService problem: breakpoint mismatch (wrong line number)", assertTrue("BreakpointService problem: breakpoint mismatch (wrong line number)",
breakpoint1.getLineNumber() == -1); breakpoint1.getLineNumber() == -1);
assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)",
@ -3297,9 +3297,9 @@ public class MIBreakpointsTest extends BaseParametrizedTestCase {
// Ensure that the breakpoint was correctly installed // Ensure that the breakpoint was correctly installed
MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref); MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref);
assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)",
breakpoint1.getFileName().equals("")); breakpoint1.getFileName().isEmpty());
assertTrue("BreakpointService problem: breakpoint mismatch (wrong function)", assertTrue("BreakpointService problem: breakpoint mismatch (wrong function)",
breakpoint1.getFunctionName().equals("")); breakpoint1.getFunctionName().isEmpty());
assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)",
breakpoint1.getCondition().equals(NO_CONDITION)); breakpoint1.getCondition().equals(NO_CONDITION));
assertTrue("BreakpointService problem: breakpoint mismatch (wrong ignore count)", assertTrue("BreakpointService problem: breakpoint mismatch (wrong ignore count)",

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2010 Wind River Systems and others. * Copyright (c) 2007, 2016 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -49,7 +49,7 @@ public abstract class AbstractImageRegistry {
* key. * key.
*/ */
protected void localImage(String key, String dir, String name) { protected void localImage(String key, String dir, String name) {
if (dir== null || dir.equals(""))//$NON-NLS-1$ if (dir== null || dir.isEmpty())
fLocations.put(key, new String[] {"icons/" + name}); //$NON-NLS-1$ fLocations.put(key, new String[] {"icons/" + name}); //$NON-NLS-1$
else else
fLocations.put(key, new String[] {"icons/" + dir + "/" + name}); //$NON-NLS-1$ //$NON-NLS-2$ fLocations.put(key, new String[] {"icons/" + dir + "/" + name}); //$NON-NLS-1$ //$NON-NLS-2$
@ -72,7 +72,7 @@ public abstract class AbstractImageRegistry {
String[] locations = new String[dirs.length]; String[] locations = new String[dirs.length];
for (int i = 0; i < dirs.length; i++) { for (int i = 0; i < dirs.length; i++) {
String dir = dirs[i]; String dir = dirs[i];
if (dir== null || dir.equals(""))//$NON-NLS-1$ if (dir== null || dir.isEmpty())
locations[i] = "icons/" + name; //$NON-NLS-1$ locations[i] = "icons/" + name; //$NON-NLS-1$
else else
locations[i] = "icons/" + dir + "/" + name; //$NON-NLS-1$ //$NON-NLS-2$ locations[i] = "icons/" + dir + "/" + name; //$NON-NLS-1$ //$NON-NLS-2$

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2015 Red Hat. * Copyright (c) 2015, 2016 Red Hat
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -414,7 +414,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
connections = DockerConnectionManager.getInstance() connections = DockerConnectionManager.getInstance()
.getConnections(); .getConnections();
if (connections.length > 0) { if (connections.length > 0) {
if (!connectionUri.equals("")) { //$NON-NLS-1$ if (!connectionUri.isEmpty()) {
String[] connectionNames = new String[connections.length]; String[] connectionNames = new String[connections.length];
for (int i = 0; i < connections.length; ++i) { for (int i = 0; i < connections.length; ++i) {
connectionNames[i] = connections[i].getName(); connectionNames[i] = connections[i].getName();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2012 QNX Software Systems and others. * Copyright (c) 2004, 2016 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -134,7 +134,7 @@ public class LaunchUtils {
if (programName != null ) { if (programName != null ) {
IPath exePath = new Path(programName); IPath exePath = new Path(programName);
IProject project = null; IProject project = null;
if (projectName != null && !projectName.equals("")) { //$NON-NLS-1$ if (projectName != null && !projectName.isEmpty()) {
project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (project == null || project.getLocation() == null) if (project == null || project.getLocation() == null)
{ {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2012 IBM Corporation and others. * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -164,7 +164,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
DirectoryDialog dialog = new DirectoryDialog(getShell()); DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setMessage(LaunchMessages.WorkingDirectoryBlock_7); dialog.setMessage(LaunchMessages.WorkingDirectoryBlock_7);
String currentWorkingDir = fWorkingDirText.getText(); String currentWorkingDir = fWorkingDirText.getText();
if (!currentWorkingDir.trim().equals("")) { //$NON-NLS-1$ if (!currentWorkingDir.trim().isEmpty()) {
File path = new File(currentWorkingDir); File path = new File(currentWorkingDir);
if (path.exists()) { if (path.exists()) {
dialog.setFilterPath(currentWorkingDir); dialog.setFilterPath(currentWorkingDir);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2015 QNX Software Systems and others. * Copyright (c) 2005, 2016 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -65,7 +65,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
} }
} catch (CoreException e) { } catch (CoreException e) {
} }
if (projectName != null && !projectName.equals("")) { //$NON-NLS-1$ if (projectName != null && !projectName.isEmpty()) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project); ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project);
if (cProject != null && cProject.exists()) { if (cProject != null && cProject.exists()) {
@ -106,7 +106,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
} }
} }
if (obj != null) { if (obj != null) {
if (programName == null || programName.equals("")) { //$NON-NLS-1$ if (programName == null || programName.isEmpty()) {
return (ICElement) obj; return (ICElement) obj;
} }
ICElement ce = (ICElement) obj; ICElement ce = (ICElement) obj;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2010-2013 Nokia Siemens Networks Oyj, Finland. * Copyright (c) 2010-2016 Nokia Siemens Networks Oyj, Finland.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -833,7 +833,7 @@ public class LlvmToolOptionPathUtil {
public static String arrayToString(String[] array) { public static String arrayToString(String[] array) {
StringBuffer sB = new StringBuffer(); StringBuffer sB = new StringBuffer();
//if array isn't empty and doesn't contain an empty String //if array isn't empty and doesn't contain an empty String
if (array.length>0 /*&& !array[0].equals("")*/) { if (array.length>0 /*&& !array[0].isEmpty()*/) {
for (String i : array) { for (String i : array) {
sB.append(i); sB.append(i);
sB.append(System.getProperty("path.separator")); //$NON-NLS-1$ sB.append(System.getProperty("path.separator")); //$NON-NLS-1$