Skip to content

Commit

Permalink
Add lambda method detection
Browse files Browse the repository at this point in the history
  • Loading branch information
JoJoDeveloping committed Sep 18, 2019
1 parent 1689118 commit 3974358
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ else if (tmp.getType() != AbstractInsnNode.LABEL)
}

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

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

0 comments on commit 3974358

Please sign in to comment.