From 7cad484a995e6ef22fea6d3e8228c7bb54e8f8bd Mon Sep 17 00:00:00 2001 From: Neo Chien Date: Sun, 26 Jan 2025 17:03:01 +0800 Subject: [PATCH] [#2349] Improvement: Fix the warning: unchecked method invocation: method put in interface Map is applied to given types (#2352) ### What changes were proposed in this pull request? Fix the warning: unchecked method invocation: method put in interface Map is applied to given types ### Why are the changes needed? Fix: #2349 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? current UT image --- .../apache/uniffle/client/record/reader/RMRecordsReader.java | 4 ++-- .../uniffle/test/RemoteMergeShuffleWithRssClientTest.java | 4 ++-- ...RemoteMergeShuffleWithRssClientTestWhenShuffleFlushed.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/main/java/org/apache/uniffle/client/record/reader/RMRecordsReader.java b/client/src/main/java/org/apache/uniffle/client/record/reader/RMRecordsReader.java index 83856bb2aa..311768d642 100644 --- a/client/src/main/java/org/apache/uniffle/client/record/reader/RMRecordsReader.java +++ b/client/src/main/java/org/apache/uniffle/client/record/reader/RMRecordsReader.java @@ -194,9 +194,9 @@ public int compare(K o1, K o2) { public void start() { for (int partitionId : partitionIds) { - mergeBuffers.put(partitionId, new Queue(maxBufferPerPartition)); + mergeBuffers.put(partitionId, new Queue<>(maxBufferPerPartition)); if (this.combiner != null) { - combineBuffers.put(partitionId, new Queue(maxBufferPerPartition)); + combineBuffers.put(partitionId, new Queue<>(maxBufferPerPartition)); } RecordsFetcher fetcher = new RecordsFetcher(partitionId); fetcher.start(); diff --git a/integration-test/common/src/test/java/org/apache/uniffle/test/RemoteMergeShuffleWithRssClientTest.java b/integration-test/common/src/test/java/org/apache/uniffle/test/RemoteMergeShuffleWithRssClientTest.java index 8a892d9a64..29336daec6 100644 --- a/integration-test/common/src/test/java/org/apache/uniffle/test/RemoteMergeShuffleWithRssClientTest.java +++ b/integration-test/common/src/test/java/org/apache/uniffle/test/RemoteMergeShuffleWithRssClientTest.java @@ -641,7 +641,7 @@ public void remoteMergeWriteReadTestMultiPartition(String classes) throws Except Map> ptb = new HashMap<>(); for (int i = PARTITION_ID; i < PARTITION_ID + 3; i++) { final int partitionId = i; - ptb.put(partitionId, new HashSet()); + ptb.put(partitionId, new HashSet<>()); ptb.get(partitionId) .addAll( blocks1.stream() @@ -854,7 +854,7 @@ public void remoteMergeWriteReadTestMultiPartitionWithCombine(String classes) th Map> ptb = new HashMap<>(); for (int i = PARTITION_ID; i < PARTITION_ID + 3; i++) { final int partitionId = i; - ptb.put(partitionId, new HashSet()); + ptb.put(partitionId, new HashSet<>()); ptb.get(partitionId) .addAll( blocks1.stream() diff --git a/integration-test/common/src/test/java/org/apache/uniffle/test/RemoteMergeShuffleWithRssClientTestWhenShuffleFlushed.java b/integration-test/common/src/test/java/org/apache/uniffle/test/RemoteMergeShuffleWithRssClientTestWhenShuffleFlushed.java index 2ab9f7b8fd..402d17ead9 100644 --- a/integration-test/common/src/test/java/org/apache/uniffle/test/RemoteMergeShuffleWithRssClientTestWhenShuffleFlushed.java +++ b/integration-test/common/src/test/java/org/apache/uniffle/test/RemoteMergeShuffleWithRssClientTestWhenShuffleFlushed.java @@ -655,7 +655,7 @@ public void remoteMergeWriteReadTestMultiPartition(String classes) throws Except Map> ptb = new HashMap<>(); for (int i = PARTITION_ID; i < PARTITION_ID + 3; i++) { final int partitionId = i; - ptb.put(partitionId, new HashSet()); + ptb.put(partitionId, new HashSet<>()); ptb.get(partitionId) .addAll( blocks1.stream() @@ -869,7 +869,7 @@ public void remoteMergeWriteReadTestMultiPartitionWithCombine(String classes) th Map> ptb = new HashMap<>(); for (int i = PARTITION_ID; i < PARTITION_ID + 3; i++) { final int partitionId = i; - ptb.put(partitionId, new HashSet()); + ptb.put(partitionId, new HashSet<>()); ptb.get(partitionId) .addAll( blocks1.stream()