Skip to content

Commit fec6ba4

Browse files
committed
Polishing
1 parent bfde33a commit fec6ba4

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

Diff for: spring-core/src/main/java/org/springframework/util/unit/DataSize.java

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,9 +25,8 @@
2525
import org.springframework.util.StringUtils;
2626

2727
/**
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.
3130
*
3231
* <p>The terms and units used in this class are based on
3332
* <a href="https://en.wikipedia.org/wiki/Binary_prefix">binary prefixes</a>
@@ -247,14 +246,14 @@ public String toString() {
247246

248247

249248
@Override
250-
public boolean equals(@Nullable Object obj) {
251-
if (this == obj) {
249+
public boolean equals(@Nullable Object other) {
250+
if (this == other) {
252251
return true;
253252
}
254-
if (obj == null || getClass() != obj.getClass()) {
253+
if (other == null || getClass() != other.getClass()) {
255254
return false;
256255
}
257-
DataSize that = (DataSize) obj;
256+
DataSize that = (DataSize) other;
258257
return (this.bytes == that.bytes);
259258
}
260259

@@ -279,7 +278,6 @@ private static DataUnit determineDataUnit(String suffix, @Nullable DataUnit defa
279278
DataUnit defaultUnitToUse = (defaultUnit != null ? defaultUnit : DataUnit.BYTES);
280279
return (StringUtils.hasLength(suffix) ? DataUnit.fromSuffix(suffix) : defaultUnitToUse);
281280
}
282-
283281
}
284282

285283
}

Diff for: spring-core/src/main/java/org/springframework/util/unit/DataUnit.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -81,6 +81,7 @@ DataSize size() {
8181
return this.size;
8282
}
8383

84+
8485
/**
8586
* Return the {@link DataUnit} matching the specified {@code suffix}.
8687
* @param suffix one of the standard suffixes

0 commit comments

Comments
 (0)