Răsfoiți Sursa

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>

2-say 7 luni în urmă
părinte
comite
33ecb443ea

+ 2 - 2
core/src/main/java/org/springframework/security/core/ComparableVersion.java

@@ -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);