-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the enclosing method references for (anonymous) classes inside…
… lambda expressions Fixes #121
- Loading branch information
Showing
5 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...lambda/src/main/java/net/orfjackal/retrolambda/lambdas/UpdateRenamedEnclosingMethods.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright © 2013-2017 Esko Luontola and other Retrolambda contributors | ||
// This software is released under the Apache License 2.0. | ||
// The license text is at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
package net.orfjackal.retrolambda.lambdas; | ||
|
||
import net.orfjackal.retrolambda.ClassAnalyzer; | ||
import net.orfjackal.retrolambda.interfaces.MethodRef; | ||
import org.objectweb.asm.ClassVisitor; | ||
|
||
import static org.objectweb.asm.Opcodes.ASM5; | ||
|
||
public class UpdateRenamedEnclosingMethods extends ClassVisitor { | ||
|
||
private final ClassAnalyzer analyzer; | ||
|
||
public UpdateRenamedEnclosingMethods(ClassVisitor next, ClassAnalyzer analyzer) { | ||
super(ASM5, next); | ||
this.analyzer = analyzer; | ||
} | ||
|
||
@Override | ||
public void visitOuterClass(String owner, String name, String desc) { | ||
MethodRef method = analyzer.getRenamedLambdaMethod(new MethodRef(0, owner, name, desc)); | ||
super.visitOuterClass(method.owner, method.name, method.desc); | ||
} | ||
} |