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

Utilize i.n.u.internal.ObjectUtil Preconditions (transport*) (#11170) #11181

Merged

Conversation

boris-unckel
Copy link
Contributor

Motivation:

NullChecks resulting in a NullPointerException or IllegalArgumentException, numeric ranges (>0, >=0) checks, not empty strings/arrays checks must never be anonymous but with the parameter or variable name which is checked. They must be specific and should not be done with an "OR-Logic" (if a == null || b == null) throw new NullPointerEx.

Modifications:

  • import static relevant checks
  • Replace manual checks with ObjectUtil methods

Result:

All checks needed are done with ObjectUtil, some exception texts are improved.

Fixes #11170
One PR for each subproject to ease review.

netty#11170)

Motivation:

NullChecks resulting in a NullPointerException or IllegalArgumentException, numeric ranges (>0, >=0) checks, not empty strings/arrays checks must never be anonymous but with the parameter or variable name which is checked. They must be specific and should not be done with an "OR-Logic" (if a == null || b == null) throw new NullPointerEx.

Modifications:

* import static relevant checks
* Replace manual checks with ObjectUtil methods

Result:

All checks needed are done with ObjectUtil, some exception texts are improved.

Fixes netty#11170
One PR for each subproject to ease review.
@boris-unckel boris-unckel force-pushed the 11170_preconditions_objectutils_transport branch from 37aa9a9 to 55e49d7 Compare April 22, 2021 10:28
@normanmaurer normanmaurer added this to the 4.1.64.Final milestone Apr 22, 2021
@normanmaurer normanmaurer merged commit c3416d8 into netty:4.1 Apr 22, 2021
@normanmaurer
Copy link
Member

Thanks

@boris-unckel boris-unckel deleted the 11170_preconditions_objectutils_transport branch April 22, 2021 12:14
normanmaurer pushed a commit that referenced this pull request Apr 22, 2021
#11170) (#11181)

Motivation:

NullChecks resulting in a NullPointerException or IllegalArgumentException, numeric ranges (>0, >=0) checks, not empty strings/arrays checks must never be anonymous but with the parameter or variable name which is checked. They must be specific and should not be done with an "OR-Logic" (if a == null || b == null) throw new NullPointerEx.

Modifications:

* import static relevant checks
* Replace manual checks with ObjectUtil methods

Result:

All checks needed are done with ObjectUtil, some exception texts are improved.

Fixes #11170
raidyue pushed a commit to raidyue/netty that referenced this pull request Jul 8, 2022
netty#11170) (netty#11181)

Motivation:

NullChecks resulting in a NullPointerException or IllegalArgumentException, numeric ranges (>0, >=0) checks, not empty strings/arrays checks must never be anonymous but with the parameter or variable name which is checked. They must be specific and should not be done with an "OR-Logic" (if a == null || b == null) throw new NullPointerEx.

Modifications:

* import static relevant checks
* Replace manual checks with ObjectUtil methods

Result:

All checks needed are done with ObjectUtil, some exception texts are improved.

Fixes netty#11170
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.

Utilize i.n.u.internal.ObjectUtil to assert Preconditions
2 participants