[JDK8] Erasure of PoolMap#remove(K,V) conflicts with superclass method

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1545800 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2013-11-26 19:55:50 +00:00
parent b849239162
commit 60c3ce0081
3 changed files with 11 additions and 3 deletions

View File

@ -260,7 +260,7 @@ public class HTablePool implements Closeable {
String tableName = Bytes.toString(table.getTableName());
if (tables.size(tableName) >= maxSize) {
// release table instance since we're not reusing it
this.tables.remove(tableName, table);
this.tables.removeValue(tableName, table);
this.tableFactory.releaseHTableInterface(table);
return;
}

View File

@ -967,7 +967,7 @@ public class RpcClient {
// release the resources
// first thing to do;take the connection out of the connection list
synchronized (connections) {
connections.remove(remoteId, this);
connections.removeValue(remoteId, this);
}
// close the streams and therefore the socket

View File

@ -88,12 +88,20 @@ public class PoolMap<K, V> implements Map<K, V> {
public V remove(Object key) {
Pool<V> pool = pools.remove(key);
if (pool != null) {
remove((K) key, pool.get());
removeValue((K) key, pool.get());
}
return null;
}
/**
* @deprecated Will be removed for Java 8, use {@link #removeValue} instead
*/
@Deprecated
public boolean remove(K key, V value) {
return removeValue(key, value);
}
public boolean removeValue(K key, V value) {
Pool<V> pool = pools.get(key);
boolean res = false;
if (pool != null) {