I’m using Sonarqube 8.9 LTS and have a false positive in my code;
Given:
public void onEntryFrom(T trigger, final Runnable entryAction) {
onEntryFrom(trigger, (BiConsumer<Transition<S, T>, C>) (t, c) -> entryAction.run());
}
public void onEntryFrom(T trigger, final BiConsumer<Transition<S, T>, C> entryAction) {
}
public void onEntryFrom(T trigger, final BiFunction<Transition<S, T>, C, T> entryAction) {
}
Sonarqube complains about the cast here (BiConsumer<Transition<S, T>, C>) (t, c) → entryAction.run()
But without the cast the compiler complains:
both method onEntryFrom(T,BiConsumer<Transition<S,T>,C>) and method onEntryFrom(T,BiFunction<Transition<S,T>,C,T>) match
where T,S,C are type-variables:
T extends Object declared in class StateConfiguration
S extends Object declared in class StateConfiguration
C extends Object declared in class StateConfiguration
Kind regards,
Michael