mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-08 19:42:48 +00:00
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
|
@Override
|
||||||
public boolean isNull() {
|
public boolean isNull() {
|
||||||
return (size() == 0);
|
return isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void normalize() {
|
void normalize() {
|
||||||
@ -434,7 +434,7 @@ class ComparableVersion implements Comparable<ComparableVersion> {
|
|||||||
@Override
|
@Override
|
||||||
public int compareTo(Item item) {
|
public int compareTo(Item item) {
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
if (size() == 0) {
|
if (isEmpty()) {
|
||||||
return 0; // 1-0 = 1- (normalize) = 1
|
return 0; // 1-0 = 1- (normalize) = 1
|
||||||
}
|
}
|
||||||
Item first = get(0);
|
Item first = get(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user