Skip to content

Commit 3974358

Browse files
Add lambda method detection
1 parent 1689118 commit 3974358

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/de/oceanlabs/mcp/mcinjector/adaptors/ApplyMap.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ else if (tmp.getType() != AbstractInsnNode.LABEL)
197197
}
198198

199199
private boolean isSynthetic(MethodNode mn){
200-
if ((mn.access & Opcodes.ACC_SYNTHETIC) != 0) return true;
200+
if ((mn.access & Opcodes.ACC_SYNTHETIC) != 0) {
201+
//de-lambdaified methods may be synthetic but actually appear in sourcecode so their args still get renamed
202+
//such methods are private and start with lambda$
203+
return (mn.access & Opcodes.ACC_PRIVATE) == 0 || !mn.name.startsWith("lambda$");
204+
}
201205

202206
//check for special case pursuant to JLS 13.1.7
203207
//which specifies that are the one and only proper methods that may be generated and not be marked synthetic

0 commit comments

Comments
 (0)