From c1c373f4278426308689db61f7758185e8f0401b Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sat, 8 Aug 2020 03:11:12 +0200 Subject: '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 --- testing-client/src/test/java/org/aspectj/testing/TesterTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testing-client') diff --git a/testing-client/src/test/java/org/aspectj/testing/TesterTest.java b/testing-client/src/test/java/org/aspectj/testing/TesterTest.java index 544e46e2f..5533739a3 100644 --- a/testing-client/src/test/java/org/aspectj/testing/TesterTest.java +++ b/testing-client/src/test/java/org/aspectj/testing/TesterTest.java @@ -190,7 +190,7 @@ public class TesterTest extends TestCase { boolean gotItem(List list, String substring) { for (IMessage element: list) { String s = element.getMessage(); - if ((null != s) && (-1 != s.indexOf(substring))) { + if ((null != s) && (s.contains(substring))) { return true; } } -- cgit v1.2.3