Skip to content

Commit

Permalink
Call long as l instead of i (netty#10578)
Browse files Browse the repository at this point in the history
Motivation:

Long should be called `l` instead of `i` because `i` is generally used for `int`.

Modification:

Changed `i` to `l`.

Result:
Better naming
  • Loading branch information
hyperxpro authored Sep 16, 2020
1 parent aa85ea9 commit 836bb74
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions common/src/main/java/io/netty/util/internal/ObjectUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public static int checkPositive(int i, String name) {
* Checks that the given argument is strictly positive. If it is not, throws {@link IllegalArgumentException}.
* Otherwise, returns the argument.
*/
public static long checkPositive(long i, String name) {
if (i <= 0) {
throw new IllegalArgumentException(name + ": " + i + " (expected: > 0)");
public static long checkPositive(long l, String name) {
if (l <= 0) {
throw new IllegalArgumentException(name + ": " + l + " (expected: > 0)");
}
return i;
return l;
}

/**
Expand All @@ -72,11 +72,11 @@ public static int checkPositiveOrZero(int i, String name) {
* Checks that the given argument is positive or zero. If it is not, throws {@link IllegalArgumentException}.
* Otherwise, returns the argument.
*/
public static long checkPositiveOrZero(long i, String name) {
if (i < 0) {
throw new IllegalArgumentException(name + ": " + i + " (expected: >= 0)");
public static long checkPositiveOrZero(long l, String name) {
if (l < 0) {
throw new IllegalArgumentException(name + ": " + l + " (expected: >= 0)");
}
return i;
return l;
}

/**
Expand Down

0 comments on commit 836bb74

Please sign in to comment.