Description
This PR refactors the SourceFilteringListener
class to replace the existing null check with Assert.state
, in line with Spring's coding standards for handling null checks. The error message has been updated to follow the guideline: it starts with the identifier (in this case, "Delegate") and ends with "must not be null."
Changes:
- Replaced manual null check with
Assert.state
in theonApplicationEventInternal
method. - Updated the exception message to:
"Delegate must not be null"
to improve clarity and ensure consistent error reporting across the codebase.
Why this change?
Using Assert.state
improves readability and ensures that error messages are consistent with Spring's coding style. This change also enhances the maintainability of the code by adhering to standard practices.
Comment From: pivotal-cla
@kwondh5217 Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-cla
@kwondh5217 Thank you for signing the Contributor License Agreement!
Comment From: snicoll
This PR refactors the SourceFilteringListener class to replace the existing null check with Assert.state, in line with Spring's coding standards for handling null checks. The error message has been updated to follow the guideline: it starts with the identifier (in this case, "Delegate") and ends with "must not be null."
Unfortunately, that's not one case that matches that guideline. What you're referring to is Assert.notNull()
and it throws an IllegalArgumentException
. The code there is fine as it is.
We are a small team with limited time to review PRs. Please be considerate of that before submitting again.
Comment From: kwondh5217
Hi @snicoll I appreciate your time in reviewing my PR and pointing this out. I'll be more careful with this distinction in the future. Thank you for your patience and the valuable feedback.