Open mahfouz72 opened 1 month ago
do we expect such check to be very different from UnusedLambdaParameterShouldBeUnnamed ?
No, almost the same
@nrmancuso, is it reasonable to combine them in one Check and manage target by "tokens" ? There prons and cons ..... for both approaches.
is it reasonable to combine them
Not by their current check name. A lambda is not a try-with-resource, and vice versa.
I am good with first post.
@nrmancuso, is it reasonable to combine them in one Check and manage target by "tokens" ? There prons and cons ..... for both approaches.
It is better to not create another JavadocMethod; small, simple, easy to reason about checks make for easy maintenance. Checking for some unused variable will have different nuances for each type (lambda, catch parameter, etc).
ok, lets do separate. code sharing is technical issue and can be resolved easily, separate testing and full independent coverage will help us to not loose us functional coverage of them individually.
child of #14942 Violate the non-use of try resources. They should be unnamed.
Originally proposed to extend
UnusedLocalVariableCheck
in #15024 but looks like the majority is voting for a new check to achieve this behaviour.Config
Example
Expected Output