Suggest replacing size() == 0 with isEmpty() for collection check

Consider using isEmpty() instead of size() == 0 to improve code readability
and follow modern Java practices.

Signed-off-by: 2-say <dev2say@gmail.com>
This commit is contained in:
2-say 2025-01-17 04:25:24 +09:00 committed by Josh Cummings
parent 17fb4d1c0d
commit 33ecb443ea
1 changed files with 2 additions and 2 deletions

View File

@ -414,7 +414,7 @@ class ComparableVersion implements Comparable<ComparableVersion> {
@Override
public boolean isNull() {
return (size() == 0);
return isEmpty();
}
void normalize() {
@ -434,7 +434,7 @@ class ComparableVersion implements Comparable<ComparableVersion> {
@Override
public int compareTo(Item item) {
if (item == null) {
if (size() == 0) {
if (isEmpty()) {
return 0; // 1-0 = 1- (normalize) = 1
}
Item first = get(0);