Skip to content

Commit

Permalink
Change key type
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjameshamilton committed Jul 28, 2022
1 parent d6d1221 commit f4308f9
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public class LambdaExpressionConverter
private final ClassVisitor extraClassVisitor;

private final Map<InvokeDynamicConstant, LambdaExpression> lambdaExpressionMap;
private final CodeAttributeEditor codeAttributeEditor;
private final MemberRemover memberRemover;
private final CodeAttributeEditor codeAttributeEditor;
private final MemberRemover memberRemover;


public LambdaExpressionConverter(ClassPool programClassPool,
Expand All @@ -74,7 +74,7 @@ public LambdaExpressionConverter(ClassPool programClassPool,
this.extraDataEntryNameMap = extraDataEntryNameMap;
this.extraClassVisitor = extraClassVisitor;

this.lambdaExpressionMap = new HashMap<InvokeDynamicConstant, LambdaExpression>();
this.lambdaExpressionMap = new HashMap<>();
this.codeAttributeEditor = new CodeAttributeEditor(true, true);
this.memberRemover = new MemberRemover();
}
Expand Down Expand Up @@ -171,10 +171,9 @@ public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute c
InvokeDynamicConstant invokeDynamicConstant =
(InvokeDynamicConstant) programClass.getConstant(constantInstruction.constantIndex);

int bootstrapMethodIndex = invokeDynamicConstant.getBootstrapMethodAttributeIndex();
if (lambdaExpressionMap.containsKey(bootstrapMethodIndex))
if (lambdaExpressionMap.containsKey(invokeDynamicConstant))
{
LambdaExpression lambdaExpression = lambdaExpressionMap.get(bootstrapMethodIndex);
LambdaExpression lambdaExpression = lambdaExpressionMap.get(invokeDynamicConstant);
String lambdaClassName = lambdaExpression.getLambdaClassName();

InstructionSequenceBuilder builder =
Expand Down

0 comments on commit f4308f9

Please sign in to comment.