IDEA-162574 False positive 'Lambda can be replaced with method reference'

This commit is contained in:
Tagir Valeev
2016-10-18 12:53:15 +07:00
parent d807cd3b24
commit ee1bd69c2e
5 changed files with 35 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
// "Replace lambda with method reference" "true"
import java.util.function.Function;
class Bar extends Random {
public void test(Object obj) {
Function<Object, int[]> fn = int[].class::cast;
}
}

View File

@@ -0,0 +1,8 @@
// "Replace lambda with method reference" "true"
import java.util.function.Function;
class Bar extends Random {
public void test(Object obj) {
Function<Object, int[]> fn = s -> (int[])<caret>s;
}
}

View File

@@ -0,0 +1,8 @@
// "Replace lambda with method reference" "false"
import java.util.function.Function;
class Bar extends Random {
public void <T> test(Object obj) {
Function<Object, T> fn = s -> (T)<caret>s;
}
}

View File

@@ -0,0 +1,8 @@
// "Replace lambda with method reference" "false"
import java.util.function.Function;
class Bar extends Random {
public void <T> test(Object obj) {
Function<Object, T[]> fn = s -> (T[])<caret>s;
}
}