[cleanup] erefactor/EclipseJdt - Invert equals arguments if parameter is constant string

EclipseJdt cleanup 'InvertEquals' applied by erefactor.

For EclipseJdt see https://www.eclipse.org/eclipse/news/4.19/jdt.php
For erefactor see https://github.com/cal101/erefactor
This commit is contained in:
cal101
2021-06-06 13:37:57 +00:00
parent c402d7cbc2
commit 86caedac50
8 changed files with 18 additions and 18 deletions

View File

@@ -102,7 +102,7 @@ public class CollUtilTest {
Collection<String> union = CollUtil.union(list1, list2);
Assert.assertEquals(3, CollUtil.count(union, t -> t.equals("b")));
Assert.assertEquals(3, CollUtil.count(union, t -> "b".equals(t)));
}
@Test
@@ -111,7 +111,7 @@ public class CollUtilTest {
ArrayList<String> list2 = CollUtil.newArrayList("a", "b", "b", "b", "c", "d");
Collection<String> intersection = CollUtil.intersection(list1, list2);
Assert.assertEquals(2, CollUtil.count(intersection, t -> t.equals("b")));
Assert.assertEquals(2, CollUtil.count(intersection, t -> "b".equals(t)));
}
@Test
@@ -236,7 +236,7 @@ public class CollUtilTest {
final String[] result = new String[1];
CollUtil.forEach(map, (key, value, index) -> {
if (key.equals("a")) {
if ("a".equals(key)) {
result[0] = value;
}
});