Skip to content

Commit 10dd350

Browse files
committed
[MINOR][CORE] Fix compilation warnings in UnsafeInMemorySorter.java
### What changes were proposed in this pull request? This pr aims to fix compilation warnings in `UnsafeInMemorySorter.java` as follows: ``` [warn] /home/runner/work/spark/spark/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java:219:1: [unchecked] unchecked method invocation: constructor <init> in class SparkOutOfMemoryError is applied to given types [warn] throw new SparkOutOfMemoryError("_LEGACY_ERROR_TEMP_3301", new HashMap()); [warn] ^ required: String,Map<String,String> [warn] found: String,HashMap [warn] /home/runner/work/spark/spark/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java:219:1: [unchecked] unchecked conversion [warn] throw new SparkOutOfMemoryError("_LEGACY_ERROR_TEMP_3301", new HashMap()); [warn] ^ required: Map<String,String> [warn] found: HashMap ``` ### Why are the changes needed? Fix compilation warnings in `UnsafeInMemorySorter.java` ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Pass GitHub Actions ### Was this patch authored or co-authored using generative AI tooling? No Closes #49546 from LuciferYang/minor-UnsafeInMemorySorter. Authored-by: yangjie01 <[email protected]> Signed-off-by: yangjie01 <[email protected]>
1 parent 3b0ac45 commit 10dd350

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public void expandPointerArray(LongArray newArray) {
216216
if (array != null) {
217217
if (newArray.size() < array.size()) {
218218
// checkstyle.off: RegexpSinglelineJava
219-
throw new SparkOutOfMemoryError("_LEGACY_ERROR_TEMP_3301", new HashMap());
219+
throw new SparkOutOfMemoryError("_LEGACY_ERROR_TEMP_3301", new HashMap<>());
220220
// checkstyle.on: RegexpSinglelineJava
221221
}
222222
Platform.copyMemory(

0 commit comments

Comments
 (0)