Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-05-24 13:27:00 -0400
committerLars Vogel2019-06-11 16:19:50 -0400
commit60e43ccd2584c9464a593b3730b405dd75ca6490 (patch)
tree9bc92baf8b2f7ac5c8357e7c09d3953d65d8a9a4
parent1d8a0c7fd655646397c3203d7c74cbc7e4a934d2 (diff)
downloadeclipse.platform.text-60e43ccd2584c9464a593b3730b405dd75ca6490.tar.gz
eclipse.platform.text-60e43ccd2584c9464a593b3730b405dd75ca6490.tar.xz
eclipse.platform.text-60e43ccd2584c9464a593b3730b405dd75ca6490.zip
String.indexOf can be replaced with String.contains
Change-Id: I4fa6df22b0e8c3bd3d59c9f98ca417899366ae03 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java2
-rw-r--r--org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/RevisionHoverInformationControlCreator.java2
-rw-r--r--org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/ScreenshotTest.java2
4 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
index 0daf9b69e..eb783f428 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
@@ -373,7 +373,7 @@ public final class RevisionPainter {
*/
private String addCSSToHTMLFragment(String html) {
int max= Math.min(100, html.length());
- if (html.substring(0, max).indexOf("<html>") != -1) //$NON-NLS-1$
+ if (html.substring(0, max).contains("<html>")) //$NON-NLS-1$
// there is already a header
return html;
diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java
index 91a73ab5d..b4057696f 100644
--- a/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java
+++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java
@@ -484,7 +484,7 @@ public class FindReplaceDocumentAdapterTest {
public void testRegexFindStackOverflow_fail() throws Exception {
// test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=102699
- if (BUG_392594 && System.getProperty("os.name").indexOf("Mac") != -1)
+ if (BUG_392594 && System.getProperty("os.name").contains("Mac"))
return; // VM crash on the Mac, see https://bugs.eclipse.org/392594
FindReplaceDocumentAdapter adapter= new FindReplaceDocumentAdapter(fDocument);
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/RevisionHoverInformationControlCreator.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/RevisionHoverInformationControlCreator.java
index 56e94401e..8d1fc8ee2 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/RevisionHoverInformationControlCreator.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/RevisionHoverInformationControlCreator.java
@@ -98,7 +98,7 @@ class RevisionHoverInformationControlCreator extends AbstractReusableInformation
*/
private String addCSSToHTMLFragment(String html) {
int max= Math.min(100, html.length());
- if (html.substring(0, max).indexOf("<html>") != -1) //$NON-NLS-1$
+ if (html.substring(0, max).contains("<html>")) //$NON-NLS-1$
// there is already a header
return html;
diff --git a/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/ScreenshotTest.java b/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/ScreenshotTest.java
index da8eff72c..59cb08b02 100644
--- a/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/ScreenshotTest.java
+++ b/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/ScreenshotTest.java
@@ -186,7 +186,7 @@ public class ScreenshotTest {
}
public static boolean isRunByGerritHudsonJob() {
- return System.getProperty("user.dir").indexOf("eclipse.platform.text-Gerrit") != -1;
+ return System.getProperty("user.dir").contains("eclipse.platform.text-Gerrit");
}
private static void runEventQueue() {

Back to the top