Skip to content

ARTEMIS-5534 use Objects.requireNonNullElse() where sensible #5771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jbertram
Copy link
Contributor

@jbertram jbertram commented Jun 11, 2025

The code-base is littered with uses of Java's ternary operator to check for null and fallback to a default value. Many of these can be replaced with either Objects.requireNonNullElse or Objects.requireNonNullElseGet. The latter is used where appropriate to essentially match the short-circuit semantics provided by the ternary operator.

@jbertram jbertram force-pushed the ARTEMIS-5534 branch 6 times, most recently from 033e50c to b3c00a2 Compare June 12, 2025 19:06
The code-base is littered with uses of Java's ternary operator to check
for null and fallback to a default value. Many of these can be replaced
with either `Objects.requireNonNullElse` or
`Objects.requireNonNullElseGet`. The latter is used where appropriate
to essentially match the short-circuit semantics provided by the
ternary operator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants