aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/java/org/aspectj/systemtest/ajc152
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-08 03:11:12 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-08 03:11:12 +0200
commitc1c373f4278426308689db61f7758185e8f0401b (patch)
tree9e03af2feb69782c50464fc1e1e2ce0d6b6bb8c5 /tests/src/test/java/org/aspectj/systemtest/ajc152
parenta508fd5315c6330f2057c219aebc35b15d0ea497 (diff)
downloadaspectj-c1c373f4278426308689db61f7758185e8f0401b.tar.gz
aspectj-c1c373f4278426308689db61f7758185e8f0401b.zip
'String.indexOf()' expression is replaceable with 'contains()'
Reports any String.indexOf() expressions which can be replaced with a call to the String.contains() method available in Java 5 and newer. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'tests/src/test/java/org/aspectj/systemtest/ajc152')
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc152/SynchronizationTransformTests.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc152/SynchronizationTransformTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc152/SynchronizationTransformTests.java
index f03ebe3f0..8c277a906 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc152/SynchronizationTransformTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc152/SynchronizationTransformTests.java
@@ -243,7 +243,7 @@ public class SynchronizationTransformTests extends XMLBasedAjcTestCase {
String[] lines = ls.getLines();
for (int i = 0; i < lines.length; i++) {
String existingLine = lines[i];
- if (fileContents[i].indexOf("MethodDeclarationLineNumber") == -1 && !fileContents[i].equals(existingLine)) {
+ if (!fileContents[i].contains("MethodDeclarationLineNumber") && !fileContents[i].equals(existingLine)) {
dump("File contents:", fileContents);
dump("Actual:", lines);
fail("\nDifference in method " + m.getName() + " on line " + i + " between the expected:\n" + fileContents[i]