String.indexOf() expressions can be replaced with a call to the String.contains() method available in Java 5 and newer.
This commit is contained in:
committed by
Juergen Hoeller
parent
81d77b9872
commit
93189a6733
@@ -84,7 +84,7 @@ public class BeanWrapperGenericsTests {
|
||||
fail("Should have thrown TypeMismatchException");
|
||||
}
|
||||
catch (TypeMismatchException ex) {
|
||||
assertTrue(ex.getMessage().indexOf("java.lang.Integer") != -1);
|
||||
assertTrue(ex.getMessage().contains("java.lang.Integer"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ public class ServiceLocatorFactoryBeanTests {
|
||||
assertNotSame(testBean2, testBean4);
|
||||
assertNotSame(testBean3, testBean4);
|
||||
|
||||
assertTrue(factory.toString().indexOf("TestServiceLocator3") != -1);
|
||||
assertTrue(factory.toString().contains("TestServiceLocator3"));
|
||||
}
|
||||
|
||||
@Ignore @Test // worked when using an ApplicationContext (see commented), fails when using BeanFactory
|
||||
|
||||
Reference in New Issue
Block a user