From 5695280edd0ba1400beaea53bb4b367e8f365222 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sun, 19 Jan 2014 14:44:58 +0100 Subject: [PATCH] removed superfluous synchronization --- source/net/yacy/kelondro/blob/HeapReader.java | 8 ++------ source/net/yacy/kelondro/blob/MapDataMining.java | 4 ++-- source/net/yacy/kelondro/blob/MapHeap.java | 4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/source/net/yacy/kelondro/blob/HeapReader.java b/source/net/yacy/kelondro/blob/HeapReader.java index 97faf0c82..6e441d34e 100644 --- a/source/net/yacy/kelondro/blob/HeapReader.java +++ b/source/net/yacy/kelondro/blob/HeapReader.java @@ -363,9 +363,7 @@ 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(); - } + return (this.index == null) ? 0 : this.index.size(); } public boolean isEmpty() { @@ -374,9 +372,7 @@ 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(); - } + return this.index.isEmpty(); } /** diff --git a/source/net/yacy/kelondro/blob/MapDataMining.java b/source/net/yacy/kelondro/blob/MapDataMining.java index f82ac01ef..cef5ca54b 100644 --- a/source/net/yacy/kelondro/blob/MapDataMining.java +++ b/source/net/yacy/kelondro/blob/MapDataMining.java @@ -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(); } diff --git a/source/net/yacy/kelondro/blob/MapHeap.java b/source/net/yacy/kelondro/blob/MapHeap.java index f0780e3a3..8aec46b90 100644 --- a/source/net/yacy/kelondro/blob/MapHeap.java +++ b/source/net/yacy/kelondro/blob/MapHeap.java @@ -440,12 +440,12 @@ public class MapHeap implements Map> { * @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(); }