diff options
author | Lars Vogel | 2019-06-19 14:22:10 +0000 |
---|---|---|
committer | Lars Vogel | 2019-06-19 14:43:54 +0000 |
commit | d18100139d2ed08f94c31ebac43e2b336a6ec294 (patch) | |
tree | 3b6ede77d404de3869ea2c500c7d25365ccc6b78 | |
parent | 9f1d691cd11293e9433b20301fccc1b3da7c039f (diff) | |
download | rt.equinox.bundles-d18100139d2ed08f94c31ebac43e2b336a6ec294.tar.gz rt.equinox.bundles-d18100139d2ed08f94c31ebac43e2b336a6ec294.tar.xz rt.equinox.bundles-d18100139d2ed08f94c31ebac43e2b336a6ec294.zip |
Use contains instead of indexOf
Change-Id: Ibe09fac3e380cdff41696836f52cc86d1194987a
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
4 files changed, 4 insertions, 4 deletions
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 846c2e371..b8c57180d 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 @@ public class AppCommands implements CommandProvider { 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 fddb04639..0818f6f98 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 @@ public class Path implements IPath, Cloneable { @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 5119f7cf6..905343a34 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 @@ public final class PluginVersionIdentifier { 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 f23143e89..bbad9b248 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 @@ public class EquinoxCommandProvider implements SynchronousBundleListener { 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; |