mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
anonymous -> lambda: conflicting ref in var declaration (IDEA-124525)
This commit is contained in:
@@ -243,6 +243,7 @@ public class AnonymousCanBeLambdaInspection extends BaseJavaBatchLocalInspection
|
||||
body.accept(new JavaRecursiveElementWalkingVisitor() {
|
||||
@Override
|
||||
public void visitVariable(PsiVariable variable) {
|
||||
super.visitVariable(variable);
|
||||
final String newName = names.get(variable);
|
||||
if (newName != null) {
|
||||
replacements.put(variable.getNameIdentifier(), elementFactory.createIdentifier(newName));
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
static class SetSubThreadReadPacket {
|
||||
private String getPostId() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public void processPacket(String p) {
|
||||
IPacketProcessor<SetSubThreadReadPacket> iPacketProcessor = p1 -> {
|
||||
String root = p1.getPostId();
|
||||
};
|
||||
}
|
||||
|
||||
private interface IPacketProcessor<T> {
|
||||
void process(SetSubThreadReadPacket p);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
static class SetSubThreadReadPacket {
|
||||
private String getPostId() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public void processPacket(String p) {
|
||||
IPacketProcessor<SetSubThreadReadPacket> iPacketProcessor = new IPacketProcessor<SetSubThrea<caret>dReadPacket>() {
|
||||
public void process(SetSubThreadReadPacket p) {
|
||||
String root = p.getPostId();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private interface IPacketProcessor<T> {
|
||||
void process(SetSubThreadReadPacket p);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user