IDEA-163980 Inspection "Collections.sort() can be replaced with List.sort()" may leave unnecessary parentheses

This commit is contained in:
Tagir Valeev
2016-11-21 14:59:02 +07:00
parent 3fa339e3dd
commit bb0a1b6817
3 changed files with 27 additions and 1 deletions
@@ -0,0 +1,13 @@
// "Replace with List.sort" "true"
import java.util.Collections;
import java.util.List;
public class Main {
void sortChildren() {
getChildren().sort(Comparator.naturalOrder());
}
List<String> getChildren() {
return new ArrayList<>();
}
}
@@ -0,0 +1,13 @@
// "Replace with List.sort" "true"
import java.util.Collections;
import java.util.List;
public class Main {
void sortChildren() {
Collections.so<caret>rt(getChildren(), Comparator.naturalOrder());
}
List<String> getChildren() {
return new ArrayList<>();
}
}