v0.7.5a: added some safety sync checks to SparseArray
This commit is contained in:
@@ -27,12 +27,27 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class SparseArray<T> extends IntMap<T> {
|
||||
|
||||
public int[] keyArray() {
|
||||
|
||||
@Override
|
||||
public synchronized T put(int key, T value) {
|
||||
return super.put(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized T get(int key, T defaultValue) {
|
||||
return super.get(key, defaultValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized T remove(int key) {
|
||||
return super.remove(key);
|
||||
}
|
||||
|
||||
public synchronized int[] keyArray() {
|
||||
return keys().toArray().toArray();
|
||||
}
|
||||
|
||||
public List<T> valueList() {
|
||||
public synchronized List<T> valueList() {
|
||||
return Arrays.asList(values().toArray().toArray());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user