1
1
/*
2
- * Copyright 2002-2023 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
25
25
import org .springframework .util .StringUtils ;
26
26
27
27
/**
28
- * A data size, such as '12MB'.
29
- *
30
- * <p>This class models data size in terms of bytes and is immutable and thread-safe.
28
+ * A data size, such as '12MB'. This class models data size in terms of
29
+ * bytes and is immutable and thread-safe.
31
30
*
32
31
* <p>The terms and units used in this class are based on
33
32
* <a href="https://en.wikipedia.org/wiki/Binary_prefix">binary prefixes</a>
@@ -247,14 +246,14 @@ public String toString() {
247
246
248
247
249
248
@ Override
250
- public boolean equals (@ Nullable Object obj ) {
251
- if (this == obj ) {
249
+ public boolean equals (@ Nullable Object other ) {
250
+ if (this == other ) {
252
251
return true ;
253
252
}
254
- if (obj == null || getClass () != obj .getClass ()) {
253
+ if (other == null || getClass () != other .getClass ()) {
255
254
return false ;
256
255
}
257
- DataSize that = (DataSize ) obj ;
256
+ DataSize that = (DataSize ) other ;
258
257
return (this .bytes == that .bytes );
259
258
}
260
259
@@ -279,7 +278,6 @@ private static DataUnit determineDataUnit(String suffix, @Nullable DataUnit defa
279
278
DataUnit defaultUnitToUse = (defaultUnit != null ? defaultUnit : DataUnit .BYTES );
280
279
return (StringUtils .hasLength (suffix ) ? DataUnit .fromSuffix (suffix ) : defaultUnitToUse );
281
280
}
282
-
283
281
}
284
282
285
283
}
0 commit comments