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:
parent
17fb4d1c0d
commit
33ecb443ea
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue