RedundantCollectionOperation: example in description, cosmetic fixes

Review ID: IDEA-CR-27215
This commit is contained in:
Tagir Valeev
2017-12-04 12:19:14 +07:00
parent f38a359e18
commit 8d382f359c
2 changed files with 8 additions and 4 deletions
@@ -1,6 +1,9 @@
<html>
<body>
Reports unnecessarily complex collection operations which have simpler alternatives.
Reports unnecessarily complex collection operations which have simpler alternatives. E.g.
<b>Arrays.asList(array).subList(0, 10).toArray(new String[0])</b> could be simplified to
<b>Arrays.copyOfRange(array, 0, 10)</b> or <b>collection.containsAll(singletonList("x"))</b> could be
simplified to <b>collection.contains("x")</b>.
<!-- tooltip end -->
<p><small>New in 2018.1</small></p>
</body>
@@ -245,10 +245,11 @@ public class RedundantCollectionOperationInspection extends AbstractBaseJavaLoca
}
private static class RedundantCollectionOperationFix implements LocalQuickFix {
private RedundantCollectionOperationHandler myHandler;
private final RedundantCollectionOperationHandler myHandler;
public RedundantCollectionOperationFix(
RedundantCollectionOperationHandler handler) {myHandler = handler;}
public RedundantCollectionOperationFix(RedundantCollectionOperationHandler handler) {
myHandler = handler;
}
@Nls
@NotNull