diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java index 36bc8e28ba1..a29d675e287 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java @@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.master; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -144,9 +145,8 @@ public class RegionStates { /** * @return an unmodifiable the region assignment map */ - @SuppressWarnings("unchecked") public synchronized Map getRegionAssignments() { - return (Map)regionAssignments.clone(); + return Collections.unmodifiableMap(regionAssignments); } /**