Blockfile: Add generics, part 4

This commit is contained in:
zzz
2016-04-20 13:08:42 +00:00
parent 0067c8d1bd
commit 436fee9200
2 changed files with 5 additions and 5 deletions

View File

@@ -540,7 +540,7 @@ public class BlockfileNamingService extends DummyNamingService {
* @return removed object or null
* @throws RuntimeException
*/
private static Object removeEntry(SkipList<String, ?> sl, String key) {
private static <V> V removeEntry(SkipList<String, V> sl, String key) {
return sl.remove(key);
}
@@ -858,12 +858,12 @@ public class BlockfileNamingService extends DummyNamingService {
SkipList<String, DestEntry> sl = _bf.getIndex(listname, _stringSerializer, _destSerializer);
if (sl == null)
return false;
Object removed = removeEntry(sl, key);
DestEntry removed = removeEntry(sl, key);
boolean rv = removed != null;
if (rv) {
removeCache(hostname);
try {
removeReverseEntry(key, ((DestEntry)removed).dest);
removeReverseEntry(key, removed.dest);
} catch (ClassCastException cce) {
_log.error("DB reverse remove error", cce);
}