mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-07-14 01:26:26 +07:00
HighlightVisitorImpl: add standard quick-fixes for lambda return value
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
// "Cast to 'int'" "true"
|
||||
import java.util.*;
|
||||
import java.util.function.*;
|
||||
|
||||
class Test {
|
||||
void test() {
|
||||
IntSupplier i = () -> (int) Math.PI;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Cast to 'int'" "true"
|
||||
import java.util.*;
|
||||
import java.util.function.*;
|
||||
|
||||
class Test {
|
||||
void test() {
|
||||
IntSupplier i = () -> Math.<caret>PI;
|
||||
}
|
||||
}
|
||||
+17
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+17
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user