removed superfluous synchronization

pull/1/head
Michael Peter Christen 11 years ago
parent a1977b7a75
commit 5695280edd

@ -363,10 +363,8 @@ public class HeapReader {
log.severe("this.index == null in size(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return 0;
}
synchronized (this.index) {
return (this.index == null) ? 0 : this.index.size();
}
}
public boolean isEmpty() {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
@ -374,10 +372,8 @@ public class HeapReader {
log.severe("this.index == null in isEmpty(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return true;
}
synchronized (this.index) {
return this.index.isEmpty();
}
}
/**
* test if a key is in the heap file. This does not need any IO, because it uses only the ram index

@ -389,12 +389,12 @@ public class MapDataMining extends MapHeap {
}
@Override
public synchronized int size() {
public int size() {
return super.size();
}
@Override
public synchronized boolean isEmpty() {
public boolean isEmpty() {
return super.isEmpty();
}

@ -440,12 +440,12 @@ public class MapHeap implements Map<byte[], Map<String, String>> {
* @return the number of entries in the table
*/
@Override
public synchronized int size() {
public int size() {
return (this.blob == null) ? 0 : this.blob.size();
}
@Override
public synchronized boolean isEmpty() {
public boolean isEmpty() {
return (this.blob == null) ? true : this.blob.isEmpty();
}

Loading…
Cancel
Save