HighlightVisitorImpl: add standard quick-fixes for lambda return value

This commit is contained in:
Tagir Valeev
2017-08-28 17:23:16 +07:00
parent 69db6f8972
commit 02a917ed17
6 changed files with 69 additions and 0 deletions
@@ -0,0 +1,9 @@
// "Cast to 'int'" "true"
import java.util.*;
import java.util.function.*;
class Test {
void test() {
IntSupplier i = () -> (int) Math.PI;
}
}
@@ -0,0 +1,9 @@
// "Cast to 'int'" "true"
import java.util.*;
import java.util.function.*;
class Test {
void test() {
IntSupplier i = () -> Math.<caret>PI;
}
}
@@ -0,0 +1,17 @@
// "Wrap using 'Math.toIntExact()'" "true"
import java.util.function.*;
public class Test {
void m() {
LongToIntFunction fn = x -> {
if(x > 0) {
return Math.toIntExact(x * 2);
}
return 0;
};
}
}
@@ -0,0 +1,17 @@
// "Wrap using 'Math.toIntExact()'" "true"
import java.util.function.*;
public class Test {
void m() {
LongToIntFunction fn = x -> {
if(x > 0) {
return x<caret>*2;
}
return 0;
};
}
}