提交 912abcb3 authored 作者: andrei's avatar andrei

code review

上级 17dcd2eb
...@@ -1743,9 +1743,7 @@ public final class MVStore { ...@@ -1743,9 +1743,7 @@ public final class MVStore {
Collections.sort(move, new Comparator<Chunk>() { Collections.sort(move, new Comparator<Chunk>() {
@Override @Override
public int compare(Chunk o1, Chunk o2) { public int compare(Chunk o1, Chunk o2) {
int res = Long.signum(o1.block - o2.block); return Long.compare(o1.block, o2.block);
assert res == Long.compare(o1.block, o2.block);
return res;
} }
}); });
// find which is the last block to keep // find which is the last block to keep
...@@ -1949,11 +1947,9 @@ public final class MVStore { ...@@ -1949,11 +1947,9 @@ public final class MVStore {
Collections.sort(old, new Comparator<Chunk>() { Collections.sort(old, new Comparator<Chunk>() {
@Override @Override
public int compare(Chunk o1, Chunk o2) { public int compare(Chunk o1, Chunk o2) {
int comp = Integer.compare(o1.collectPriority, int comp = Integer.compare(o1.collectPriority, o2.collectPriority);
o2.collectPriority);
if (comp == 0) { if (comp == 0) {
comp = Long.compare(o1.maxLenLive, comp = Long.compare(o1.maxLenLive, o2.maxLenLive);
o2.maxLenLive);
} }
return comp; return comp;
} }
......
...@@ -565,7 +565,6 @@ public abstract class Page implements Cloneable ...@@ -565,7 +565,6 @@ public abstract class Page implements Cloneable
*/ */
public abstract void insertNode(int index, Object key, Page childPage); public abstract void insertNode(int index, Object key, Page childPage);
@SuppressWarnings("SuspiciousSystemArraycopy")
final void insertKey(int index, Object key) { final void insertKey(int index, Object key) {
int keyCount = getKeyCount(); int keyCount = getKeyCount();
assert index <= keyCount : index + " > " + keyCount; assert index <= keyCount : index + " > " + keyCount;
...@@ -1285,7 +1284,6 @@ public abstract class Page implements Cloneable ...@@ -1285,7 +1284,6 @@ public abstract class Page implements Cloneable
} }
@Override @Override
@SuppressWarnings("SuspiciousSystemArraycopy")
public void insertLeaf(int index, Object key, Object value) { public void insertLeaf(int index, Object key, Object value) {
int keyCount = getKeyCount(); int keyCount = getKeyCount();
insertKey(index, key); insertKey(index, key);
......
...@@ -48,7 +48,6 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> { ...@@ -48,7 +48,6 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
} }
@Override @Override
@SuppressWarnings("unchecked")
public V get(Object key) { public V get(Object key) {
V result = get(getRootPage(), key); V result = get(getRootPage(), key);
return result; return result;
...@@ -130,7 +129,6 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> { ...@@ -130,7 +129,6 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
* @return the old value if the key existed, or null otherwise * @return the old value if the key existed, or null otherwise
*/ */
@Override @Override
@SuppressWarnings("unchecked")
public V remove(Object key) { public V remove(Object key) {
return operate((SpatialKey) key, null, DecisionMaker.REMOVE); return operate((SpatialKey) key, null, DecisionMaker.REMOVE);
} }
...@@ -295,7 +293,6 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> { ...@@ -295,7 +293,6 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
} }
@Override @Override
@SuppressWarnings("unchecked")
public V put(SpatialKey key, V value) { public V put(SpatialKey key, V value) {
return operate(key, value, DecisionMaker.PUT); return operate(key, value, DecisionMaker.PUT);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论