-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
Description
public Whatever doIt() {
.....
return thing.doIt();
....
return thing.doIt(); //genrates PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS
}These calls cannot possibly be redundant because they both exit the method meaning there can never be a situation where both of them execute.
The actual example is a Builder pattern where thing.doIt() is more like Thing.builder().....build()
and it is incorrect to declare a Thing.ThingBuilder thingBuilder = Thing.builder() and reuse it all over the place (without invoking thingBuilder().clear() before each reuse) which is what this checker would have one do,
Reactions are currently unavailable