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
Several variations, some will be more complex to implement than others if attempting to identify all uses of (this list isn't exhaustive):
use error() in place of throw IllegalStateException
use check() in place of a conditional IllegalStateException
use checkNotNull() in place of a null check conditional IllegalStateException
use require() in place of a conditional IllegalArgumentException
use requireNotNull() in place of a null check conditional IllegalArgumentException
To simplify implementation the rule could flag any use of any IllegalStateException and IllegalArgumentException and advise to use one of error, check, checkNotNull or require, requireNotNull respectively.
Expected Behavior of the rule
Several variations, some will be more complex to implement than others if attempting to identify all uses of (this list isn't exhaustive):
error()
in place ofthrow IllegalStateException
check()
in place of a conditionalIllegalStateException
checkNotNull()
in place of a null check conditionalIllegalStateException
require()
in place of a conditionalIllegalArgumentException
requireNotNull()
in place of a null check conditionalIllegalArgumentException
To simplify implementation the rule could flag any use of any
IllegalStateException
andIllegalArgumentException
and advise to use one of error, check, checkNotNull or require, requireNotNull respectively.Context
Inspired by https://www.bignerdranch.com/blog/write-better-code-using-kotlins-require-check-and-assert/
The text was updated successfully, but these errors were encountered: