Skip to content
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

OAK-10711 : replaced preconditions.checkNotNull with Objects.requireNotNull #1480

Merged
merged 3 commits into from
Aug 15, 2024

Conversation

rishabhdaim
Copy link
Contributor

…otNull

@stefan-egli
Copy link
Contributor

no actual review just a comment : should we wait until after the release (with such a large change, even though seeming trivial) ?

@reschke
Copy link
Contributor

reschke commented Aug 13, 2024

I'd also like to take the opportunity to move the new imports to the "right" place, if only for consistency with all the other changes we already made.

Let me have a look at this later this week.

@reschke reschke changed the title OAK-10711 : replaced preconditions.checkNotNull with Objects.requireN… OAK-10711 : replaced preconditions.checkNotNull with Objects.requireNotNull Aug 14, 2024
@reschke
Copy link
Contributor

reschke commented Aug 14, 2024

Using...

for i in $(grep -rl "Objects.requireNonNull" .) ; do num=$(grep "import static" $i | wc -l) ; [ $num -gt 1 ] && (grep "import static" $i > x1 ; sort x1 > x2 ; cmp -s x1 x2 ||  ( diff -u x1 x2 | (grep -q "+import static java.util.Objects.requireNonNull") && (echo ; echo $num; echo ; echo $i ; echo ; diff -u x1 x2 ))) ; done

I identified files where the static imports now needed some reshuffling.

Note that while doing this, I also found a case where the "new" import was already present, so we got a warning about duplicate imports.

@reschke reschke merged commit 7fd1a13 into trunk Aug 15, 2024
1 of 2 checks passed
@reschke reschke deleted the OAK-10711 branch August 15, 2024 08:07
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.

3 participants