Find calls that always throw
ProprietaryMarks a call whose arguments fail a check at the start of the method or constructor it calls, so that the call always throws. A check is an if whose body throws, or a call to Objects.requireNonNull, or the not-null and argument checks of Guava, Commons Lang and Spring, the state checks of Guava and Spring, and Spring's hasLength and hasText. A call is marked when its literal arguments, such as null or -1, decide that a check throws. Only calls to static, private or final methods, to constructors and to methods of final classes are checked, since an override may check otherwise. Calls inside a try that catches the exception, or inside a lambda passed to an assertion that expects an exception, are left alone. Test sources are not searched.
io. moderne. staticanalysis. FindCallThatThrowsmod run . --recipe= io. moderne. staticanalysis. FindCallThatThrowsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.