rpau/javalang-compiler

MethodDeclaration.usages should include usages by lambdas

Closed this issue · 3 comments

I have previously raised walkmod/walkmod-dead-code-cleaner-plugin#4 where code was incorrectly deleted because classes & methods that were being used in lambdas were incorrectly being identified as unused. The dead code cleaner plugin uses MethodDeclaration.usages to determine whether a method is in use or not. This list is not being populated with usages from lambdas.

I have created a test case that recreates the problem. Please see PR#77

Any guidance on how to fix the problem would be much appreciated

rpau commented

Fixed here: #78

Thank you for fixing this! I've raised #79 which is a similar corner case,