You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[java] ExceptionAsFlowControl: False negative when the lambda is invoked by the method it is passed to #7117
ExceptionAsFlowControl no longer reports a throw inside a lambda body. That fixed the false positive of #4815, but it also stopped reporting the case where the lambda is invoked by the method it is passed to.
From spring-framework's LeakAwareNettyDataBufferFactory#checkForLeaks (v5.3.13, lines 50-68, source):
Iterable.forEach calls the lambda it is passed and relays an exception thrown by it to the caller, so that throw is caught by the catch right below it - the control flow this rule is about.
Reproduced on main (7.29.0-SNAPSHOT, ef27e2a): the rule reports nothing on that file, and the same code as a rule test fixture fails with Expected 1 problem(s), 0 problem(s) found.
Raised by @UncleOwen in the review of #7105; @zbynek suggested that all methods of Stream that take a lambda should be treated the same.
A fix would keep the walk going through a lambda that is an argument of a call whose method calls that argument (Iterable.forEach, Iterator.forEachRemaining, Map.forEach, Optional.ifPresent/ifPresentOrElse, and the Stream methods that take a lambda argument), and leave every other lambda opaque, so that #4815 does not come back.
changed the title [-][java] ExceptionAsFlowControl: false negative when the lambda runs in the calling thread[/-][+][java] ExceptionAsFlowControl: false negative when the lambda is invoked by the method it is passed to[/+]on Sep 28, 2026
changed the title [-][java] ExceptionAsFlowControl: false negative when the lambda is invoked by the method it is passed to[/-][+][java] ExceptionAsFlowControl: False negative when the lambda is invoked by the method it is passed to[/+]on Oct 29, 2026
Activity
[-][java] ExceptionAsFlowControl: false negative when the lambda runs in the calling thread[/-][+][java] ExceptionAsFlowControl: false negative when the lambda is invoked by the method it is passed to[/+][-][java] ExceptionAsFlowControl: false negative when the lambda is invoked by the method it is passed to[/-][+][java] ExceptionAsFlowControl: False negative when the lambda is invoked by the method it is passed to[/+]