Use contains instead of indexOf
Change-Id: Ibe09fac3e380cdff41696836f52cc86d1194987a
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
diff --git a/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/AppCommands.java b/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/AppCommands.java
index 846c2e3..b8c5718 100644
--- a/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/AppCommands.java
+++ b/bundles/org.eclipse.equinox.app/src/org/eclipse/equinox/internal/app/AppCommands.java
@@ -234,7 +234,7 @@
return apps[i]; // always return a perfect match
if (perfectMatch)
continue;
- if (id.indexOf(targetId) >= 0) {
+ if (id.contains(targetId)) {
if (result != null)
ambigous = true;
result = apps[i];
diff --git a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/Path.java b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/Path.java
index fddb046..0818f6f 100644
--- a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/Path.java
+++ b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/Path.java
@@ -319,7 +319,7 @@
@Override
public IPath append(String tail) {
//optimize addition of a single segment
- if (tail.indexOf(SEPARATOR) == -1 && tail.indexOf("\\") == -1 && tail.indexOf(DEVICE_SEPARATOR) == -1) { //$NON-NLS-1$
+ if (tail.indexOf(SEPARATOR) == -1 && !tail.contains("\\") && tail.indexOf(DEVICE_SEPARATOR) == -1) { //$NON-NLS-1$
int tailLength = tail.length();
if (tailLength < 3) {
//some special cases
diff --git a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/PluginVersionIdentifier.java b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/PluginVersionIdentifier.java
index 5119f7c..905343a 100644
--- a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/PluginVersionIdentifier.java
+++ b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/PluginVersionIdentifier.java
@@ -155,7 +155,7 @@
Assert.isTrue(false, NLS.bind(CommonMessages.parse_separatorStartVersion, s));
if (s.endsWith(SEPARATOR))
Assert.isTrue(false, NLS.bind(CommonMessages.parse_separatorEndVersion, s));
- if (s.indexOf(SEPARATOR + SEPARATOR) != -1)
+ if (s.contains(SEPARATOR + SEPARATOR))
Assert.isTrue(false, NLS.bind(CommonMessages.parse_doubleSeparatorVersion, s));
StringTokenizer st = new StringTokenizer(s, SEPARATOR);
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java
index f23143e..bbad9b2 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java
@@ -1350,7 +1350,7 @@
if ((toFilter.getState() & searchedState) == 0) {
return false;
}
- if (searchedName != null && searchedName.length > 0 && toFilter.getSymbolicName() != null && toFilter.getSymbolicName().indexOf(searchedName[0]) == -1) {
+ if (searchedName != null && searchedName.length > 0 && toFilter.getSymbolicName() != null && !toFilter.getSymbolicName().contains(searchedName[0])) {
return false;
}
return true;