From f021149aa73576a9a9fd05ba00fcf7e5d1901318 Mon Sep 17 00:00:00 2001 From: zhangminglei Date: Wed, 18 Apr 2018 09:24:57 +0800 Subject: [PATCH] [FLINK-8661] Replace Collections.EMPTY_MAP with Collections.emptyMap() --- .../runtime/clusterframework/types/ResourceProfile.java | 2 +- .../clusterframework/types/ResourceProfileTest.java | 8 ++++---- .../runtime/rest/messages/JobAccumulatorsInfoTest.java | 2 +- .../src/test/java/org/apache/flink/yarn/UtilsTest.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java b/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java index 8fbaed15ca34a..a89b9f92b17c7 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java @@ -106,7 +106,7 @@ public ResourceProfile( * @param heapMemoryInMB The size of the heap memory, in megabytes. */ public ResourceProfile(double cpuCores, int heapMemoryInMB) { - this(cpuCores, heapMemoryInMB, 0, 0, 0, Collections.EMPTY_MAP); + this(cpuCores, heapMemoryInMB, 0, 0, 0, Collections.emptyMap()); } /** diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/types/ResourceProfileTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/types/ResourceProfileTest.java index 7ed688afdc283..6f54d7fa55e53 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/types/ResourceProfileTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/types/ResourceProfileTest.java @@ -31,10 +31,10 @@ public class ResourceProfileTest { @Test public void testMatchRequirement() throws Exception { - ResourceProfile rp1 = new ResourceProfile(1.0, 100, 100, 100, 0, Collections.EMPTY_MAP); - ResourceProfile rp2 = new ResourceProfile(1.0, 200, 200, 200, 0, Collections.EMPTY_MAP); - ResourceProfile rp3 = new ResourceProfile(2.0, 100, 100, 100, 0, Collections.EMPTY_MAP); - ResourceProfile rp4 = new ResourceProfile(2.0, 200, 200, 200, 0, Collections.EMPTY_MAP); + ResourceProfile rp1 = new ResourceProfile(1.0, 100, 100, 100, 0, Collections.emptyMap()); + ResourceProfile rp2 = new ResourceProfile(1.0, 200, 200, 200, 0, Collections.emptyMap()); + ResourceProfile rp3 = new ResourceProfile(2.0, 100, 100, 100, 0, Collections.emptyMap()); + ResourceProfile rp4 = new ResourceProfile(2.0, 200, 200, 200, 0, Collections.emptyMap()); assertFalse(rp1.isMatching(rp2)); assertTrue(rp2.isMatching(rp1)); diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobAccumulatorsInfoTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobAccumulatorsInfoTest.java index e0e9649b503c1..856d855b8334c 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobAccumulatorsInfoTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobAccumulatorsInfoTest.java @@ -47,6 +47,6 @@ protected JobAccumulatorsInfo getTestResponseInstance() throws Exception { "uta3.type", "uta3.value")); - return new JobAccumulatorsInfo(Collections.emptyList(), userAccumulatorList, Collections.EMPTY_MAP); + return new JobAccumulatorsInfo(Collections.emptyList(), userAccumulatorList, Collections.emptyMap()); } } diff --git a/flink-yarn/src/test/java/org/apache/flink/yarn/UtilsTest.java b/flink-yarn/src/test/java/org/apache/flink/yarn/UtilsTest.java index 578e8e202011f..b7a38b08ba2a1 100644 --- a/flink-yarn/src/test/java/org/apache/flink/yarn/UtilsTest.java +++ b/flink-yarn/src/test/java/org/apache/flink/yarn/UtilsTest.java @@ -201,7 +201,7 @@ public Object answer(InvocationOnMock invocation) throws Throwable { expectMsgClass(deadline.timeLeft(), RegisterResourceManager.class); - resourceManagerGateway.tell(new RegisterResourceManagerSuccessful(leader1, Collections.EMPTY_LIST)); + resourceManagerGateway.tell(new RegisterResourceManagerSuccessful(leader1, Collections.emptyList())); for (int i = 0; i < containerList.size(); i++) { expectMsgClass(deadline.timeLeft(), Acknowledge.class); @@ -217,7 +217,7 @@ public Object answer(InvocationOnMock invocation) throws Throwable { expectMsgClass(deadline.timeLeft(), RegisterResourceManager.class); - resourceManagerGateway.tell(new RegisterResourceManagerSuccessful(leader1, Collections.EMPTY_LIST)); + resourceManagerGateway.tell(new RegisterResourceManagerSuccessful(leader1, Collections.emptyList())); for (Container container: containerList) { resourceManagerGateway.tell(