You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2025/06/10 21:26:00 UTC

[jira] [Created] (ARTEMIS-5533) Use Objects.requireNonNull() where sensible

Justin Bertram created ARTEMIS-5533:
---------------------------------------

             Summary: Use Objects.requireNonNull() where sensible
                 Key: ARTEMIS-5533
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5533
             Project: ActiveMQ Artemis
          Issue Type: Improvement
            Reporter: Justin Bertram
            Assignee: Justin Bertram


There are lots of places across the code-base which do a check like this:
{code:java}
if (foo == null) {
   throw new NullPointerException("foo should not be null");
}{code}
These can be simplified, e.g.:
{code:java}
Objects.requireNonNull(foo, "foo should not be null"){code}
Furthermore since {{requireNonNull}} returns the input some of these checks can be inlined with assignments.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact