mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 17:07:05 +07:00
ensure anonymous is not converted to lambda/method ref if it contains inner classes or class initializers
(cherry picked from commit 32afe318e3bacd714f3e0b49d8f904402b17a9c2)
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
// "Replace with lambda" "false"
|
||||
import java.util.*;
|
||||
class Test2 {
|
||||
|
||||
interface I<X> {
|
||||
X foo(List<X> list);
|
||||
}
|
||||
|
||||
static <T> I<T> bar(I<T> i){return i;}
|
||||
|
||||
{
|
||||
bar(new I<Stri<caret>ng>() {
|
||||
{
|
||||
System.out.println("hi!");
|
||||
}
|
||||
@Override
|
||||
public String foo(List<String> list) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Replace with lambda" "false"
|
||||
import java.util.*;
|
||||
class Test2 {
|
||||
|
||||
interface I<X> {
|
||||
X foo(List<X> list);
|
||||
}
|
||||
|
||||
static <T> I<T> bar(I<T> i){return i;}
|
||||
|
||||
{
|
||||
bar(new I<Stri<caret>ng>() {
|
||||
class UF {}
|
||||
@Override
|
||||
public String foo(List<String> list) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user