Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-05-24 12:26:19 -0400
committerEd Merks2019-05-28 03:28:37 -0400
commitdf005ec515e92c0232fa918eb6cbe5218e1cf790 (patch)
tree730617171d5913cc84852d70794a91952eb4155d
parent9dbfeba286b5e9b1b754790eabe333789e21278f (diff)
downloadorg.eclipse.emf-df005ec515e92c0232fa918eb6cbe5218e1cf790.tar.gz
org.eclipse.emf-df005ec515e92c0232fa918eb6cbe5218e1cf790.tar.xz
org.eclipse.emf-df005ec515e92c0232fa918eb6cbe5218e1cf790.zip
[547629] String.indexOf can be replaced with String.contains
Change-Id: I330e5538d6c3ec70677cf980f99f6789cdc6745c Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/util/SegmentSequence.java4
-rw-r--r--plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/util/SegmentSequence.java b/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/util/SegmentSequence.java
index 5651f7071..9e14e424c 100644
--- a/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/util/SegmentSequence.java
+++ b/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/util/SegmentSequence.java
@@ -138,7 +138,7 @@ public final class SegmentSequence implements CharSequence
}
// If the segment contains the delimiter...
//
- else if (segment.indexOf(delimiter) != -1)
+ else if (segment.contains(delimiter))
{
// Create a segment sequence for the segment and append that instead.
//
@@ -2807,7 +2807,7 @@ public final class SegmentSequence implements CharSequence
// If the segment contains the delimiter...
//
String segment = segments[i];
- if (segment.indexOf(delimiter) != -1)
+ if (segment.contains(delimiter))
{
// Create a segment sequence for the segment, to reuse the efficient logic for splitting a name, and pull out the segments from that result.
//
diff --git a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
index 5de8dd237..f5ee8d121 100644
--- a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
+++ b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
@@ -327,7 +327,7 @@ public class BasicExtendedMetaData implements ExtendedMetaData
public boolean isAnonymous(EClassifier eClassifier)
{
String name = getExtendedMetaData(eClassifier).getName();
- return name.length() == 0 || name.indexOf("_._") != -1;
+ return name.length() == 0 || name.contains("_._");
}
public String getName(EStructuralFeature eStructuralFeature)

Back to the top