IDEA-184154 Use Comparator combinator fix produces red code

This commit is contained in:
Tagir Valeev
2017-12-22 13:38:38 +07:00
parent 390cec4927
commit 89ac7f414a
5 changed files with 65 additions and 2 deletions
@@ -0,0 +1,15 @@
// "Replace with Comparator.comparing" "true"
import java.util.Comparator;
public class MyTest {
void setComparator(Comparator<?> comparator) {
}
String getValue() {
return "";
}
{
setComparator(Comparator.comparing(MyTest::getValue));
}
}
@@ -0,0 +1,15 @@
// "Replace with Comparator.comparing" "true"
import java.util.Comparator;
public class MyTest {
void setComparator(Comparator<?> comparator) {
}
String getValue(int x) {
return "";
}
{
setComparator(Comparator.comparing((MyTest o) -> o.getValue(0)));
}
}
@@ -0,0 +1,15 @@
// "Replace with Comparator.comparing" "true"
import java.util.Comparator;
public class MyTest {
void setComparator(Comparator<?> comparator) {
}
String getValue() {
return "";
}
{
setComparator((MyTest o1, <caret>MyTest o2) -> o1.getValue().compareTo(o2.getValue()));
}
}
@@ -0,0 +1,15 @@
// "Replace with Comparator.comparing" "true"
import java.util.Comparator;
public class MyTest {
void setComparator(Comparator<?> comparator) {
}
String getValue(int x) {
return "";
}
{
setComparator((MyTest o1, <caret>MyTest o2) -> o1.getValue(0).compareTo(o2.getValue(0)));
}
}