Skip to content

Commit 11f6999

Browse files
author
Ilya Ganelin
committed
Nit fixes
1 parent 49a8720 commit 11f6999

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

core/src/test/scala/org/apache/spark/util/UtilsSuite.scala

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,10 @@ class UtilsSuite extends FunSuite with ResetSystemProperties {
174174
intercept[NumberFormatException] {
175175
Utils.byteStringAsBytes("600gb This breaks")
176176
}
177-
177+
178178
intercept[NumberFormatException] {
179179
Utils.byteStringAsBytes("This 123mb breaks")
180180
}
181-
182-
// // Test overflow
183-
// intercept[NumberFormatException] {
184-
//
185-
//
186-
// ByteUnit.convertTo(0x7fffffffffffffffL, ByteUnit.KiB)
187-
// }
188181
}
189182

190183
test("bytesToString") {

network/common/src/main/java/org/apache/spark/network/util/ByteUnit.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public long convertTo(long d, ByteUnit u) {
3939
if (multiplier > u.multiplier) {
4040
long ratio = multiplier / u.multiplier;
4141
if (Long.MAX_VALUE / ratio < d) {
42-
throw new IllegalArgumentException("Conversion of" + d + "exceeds Long.MAX_VALUE in "
43-
+ name() + ". Try a larger suffix (e.g. MiB instead of KiB)");
42+
throw new IllegalArgumentException("Conversion of " + d + " exceeds Long.MAX_VALUE in "
43+
+ name() + ". Try a larger unit (e.g. MiB instead of KiB)");
4444
}
4545
return d * ratio;
4646
} else {

0 commit comments

Comments
 (0)