mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 18:50:54 +07:00
anonym -> lambda: decode context correctly
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
class Test {
|
||||
{
|
||||
Comparable<String> c = o -> {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(o);
|
||||
}
|
||||
};
|
||||
return 0;
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(o);
|
||||
}
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
class Test {
|
||||
{
|
||||
Comparable<String> c = o -> {
|
||||
System.out.println();
|
||||
return 0;
|
||||
System.out.println();
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
interface I {
|
||||
|
||||
}
|
||||
interface Bar extends I {
|
||||
int smth = 0;
|
||||
int compare(String o1, String o2);
|
||||
}
|
||||
{
|
||||
I bar2 = (Bar) (o1, o2) -> {
|
||||
System.out.println(Bar.smth);
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
class Test {
|
||||
{
|
||||
Runnable r = () -> {
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
class Test {
|
||||
{
|
||||
Runnable[] r = new Runnable[] {() -> {
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
}};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// "Replace with lambda" "false"
|
||||
class Test {
|
||||
interface I {
|
||||
|
||||
}
|
||||
interface Bar extends I {
|
||||
int compare(String o1, String o2);
|
||||
}
|
||||
{
|
||||
I bar2 = new Ba<caret>r() {
|
||||
int k;
|
||||
@Override
|
||||
public int compare(String o1, String o2) {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
interface I {
|
||||
|
||||
}
|
||||
interface Bar extends I {
|
||||
int smth = 0;
|
||||
int compare(String o1, String o2);
|
||||
}
|
||||
{
|
||||
I bar2 = new Ba<caret>r() {
|
||||
@Override
|
||||
public int compare(String o1, String o2) {
|
||||
System.out.println(smth);
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user