mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
anonymous -> lambda: stop on calls to j.l.Object methods of anonym classes (IDEA-203343)
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
// "Fix all 'Anonymous type can be replaced with lambda' problems in file" "true"
|
||||
import java.util.concurrent.Callable;
|
||||
class MyTest {
|
||||
|
||||
interface A {
|
||||
void foo();
|
||||
default void m() {}
|
||||
}
|
||||
|
||||
static {
|
||||
Callable<Integer> c = new Callable<Integer>() {
|
||||
@Override
|
||||
public Integer call() {
|
||||
return hashCode();
|
||||
}
|
||||
};
|
||||
A a = new A() {
|
||||
@Override
|
||||
public void foo() {
|
||||
m();
|
||||
}
|
||||
};
|
||||
A b = () -> new Object();
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// "Fix all 'Anonymous type can be replaced with lambda' problems in file" "true"
|
||||
import java.util.concurrent.Callable;
|
||||
class MyTest {
|
||||
|
||||
interface A {
|
||||
void foo();
|
||||
default void m() {}
|
||||
}
|
||||
|
||||
static {
|
||||
Callable<Integer> c = new Callable<Integer>() {
|
||||
@Override
|
||||
public Integer call() {
|
||||
return hashCode();
|
||||
}
|
||||
};
|
||||
A a = new A() {
|
||||
@Override
|
||||
public void foo() {
|
||||
m();
|
||||
}
|
||||
};
|
||||
A b = new <caret>A() {
|
||||
@Override
|
||||
public void foo() {
|
||||
new Object();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user