mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
IDEA-124385
This commit is contained in:
@@ -253,7 +253,7 @@ public class AnonymousCanBeLambdaInspection extends BaseJavaBatchLocalInspection
|
||||
public void visitReferenceExpression(PsiReferenceExpression expression) {
|
||||
super.visitReferenceExpression(expression);
|
||||
final PsiElement resolve = expression.resolve();
|
||||
if (resolve instanceof PsiParameter) {
|
||||
if (resolve instanceof PsiVariable) {
|
||||
final String newName = names.get(resolve);
|
||||
if (newName != null) {
|
||||
replacements.put(expression, elementFactory.createExpressionFromText(newName, expression));
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Replace with lambda" "true"
|
||||
class X1 {
|
||||
|
||||
public void testLambdaConversionBug() {
|
||||
Object data = new Object();
|
||||
new Thread(() -> {
|
||||
System.out.println(data.getClass());
|
||||
{
|
||||
Integer data1 =1;
|
||||
System.out.println(data1.longValue());
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// "Replace with lambda" "true"
|
||||
class X1 {
|
||||
|
||||
public void testLambdaConversionBug() {
|
||||
Object data = new Object();
|
||||
new Thread(new Runn<caret>able() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(data.getClass());
|
||||
{
|
||||
Integer data=1;
|
||||
System.out.println(data.longValue());
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user