Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-07-04 11:46:41 -0400
committerLars Vogel2019-07-05 06:30:01 -0400
commit19631f4aaf382abcbe5229f77ceb41d376753bad (patch)
tree6c99918088c7f2f0367471d96e539fa43cb9f912
parent60b189fe68c05a101f8c9f16dcb863e7e6717b6b (diff)
downloadeclipse.platform.text-19631f4aaf382abcbe5229f77ceb41d376753bad.tar.gz
eclipse.platform.text-19631f4aaf382abcbe5229f77ceb41d376753bad.tar.xz
eclipse.platform.text-19631f4aaf382abcbe5229f77ceb41d376753bad.zip
See https://sourceforge.net/p/findbugs/feature-requests/300/#cb7f for a performance related discussion Change-Id: If69738a092217087471d6013669c26e1854231d4 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractPairMatcherTest.java8
-rw-r--r--org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java6
2 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractPairMatcherTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractPairMatcherTest.java
index cbc7b5812..db8b2ffea 100644
--- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractPairMatcherTest.java
+++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractPairMatcherTest.java
@@ -377,13 +377,13 @@ public abstract class AbstractPairMatcherTest {
* @return the created test case
*/
public TestCase createTestCase(String str) {
- int pos1= str.indexOf("%");
+ int pos1= str.indexOf('%');
assertFalse(pos1 == -1);
- int pos2= str.lastIndexOf("%");
+ int pos2= str.lastIndexOf('%');
boolean selectionTest= pos1 != pos2;
- int match1= str.indexOf("#");
- int match2= str.lastIndexOf("#");
+ int match1= str.indexOf('#');
+ int match2= str.lastIndexOf('#');
boolean enclosingTest= match1 != match2;
// account for the length of marker characters
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 d0a6b3fcc..517939d27 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
@@ -355,7 +355,7 @@ public class FindReplaceDocumentAdapterTest {
String contents= "Unix\nWindows\r\nMac\rEnd";
fDocument.set(contents);
- int n= contents.indexOf("\n");
+ int n= contents.indexOf('\n');
int rn= contents.indexOf("\r\n");
int r= contents.indexOf("\rEnd");
@@ -378,7 +378,7 @@ public class FindReplaceDocumentAdapterTest {
String contents= "Unix\n[\\R]\\R\r\n";
fDocument.set(contents);
- int n= contents.indexOf("\n");
+ int n= contents.indexOf('\n');
int rn= contents.indexOf("\r\n");
IRegion region= adapter.find(0, "[a-zA-Z\\t{\\\\R}]*\\{?\\R", true, false, false, true);
@@ -401,7 +401,7 @@ public class FindReplaceDocumentAdapterTest {
String contents= "+[\\R]\\R\r\n";
fDocument.set(contents);
- int n= contents.indexOf("[");
+ int n= contents.indexOf('[');
int rn= contents.indexOf("\r\n");
IRegion region= adapter.find(0, "[a-zA-Z\\t{\\\\R}]*\\{?\\R", true, false, false, true);

Back to the top