From 3c68905540df5df8e8b8d9d66a8286635e2f5b78 Mon Sep 17 00:00:00 2001 From: danielr Date: Wed, 20 Aug 2008 08:37:39 +0000 Subject: [PATCH] remove redundant null checks git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5065 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/SettingsAck_p.java | 3 +-- source/de/anomic/crawler/CrawlQueues.java | 2 +- source/de/anomic/data/userDB.java | 17 +++++++++-------- .../de/anomic/kelondro/kelondroBLOBArray.java | 6 +++--- .../anomic/kelondro/kelondroRowCollection.java | 4 ++-- .../plasma/plasmaSearchRankingProcess.java | 12 +++++------- source/de/anomic/plasma/plasmaWordIndex.java | 4 ++-- 7 files changed, 23 insertions(+), 25 deletions(-) diff --git a/htroot/SettingsAck_p.java b/htroot/SettingsAck_p.java index 822684aa5..805a9e2de 100644 --- a/htroot/SettingsAck_p.java +++ b/htroot/SettingsAck_p.java @@ -424,8 +424,7 @@ public class SettingsAck_p { for (int i=0; i= 0) : "get: access with index " + index + " is below zero"; assert (index < chunkcount) : "get: access with index " + index + " is above chunkcount " + chunkcount + "; sortBound = " + sortBound; - assert (index * rowdef.objectsize < chunkcache.length); + assert (chunkcache != null && index * rowdef.objectsize < chunkcache.length); assert sortBound <= chunkcount : "sortBound = " + sortBound + ", chunkcount = " + chunkcount; if ((chunkcache == null) || (rowdef == null)) return null; // case may appear during shutdown kelondroRow.Entry entry; diff --git a/source/de/anomic/plasma/plasmaSearchRankingProcess.java b/source/de/anomic/plasma/plasmaSearchRankingProcess.java index 4fcc1825c..9e4304d88 100644 --- a/source/de/anomic/plasma/plasmaSearchRankingProcess.java +++ b/source/de/anomic/plasma/plasmaSearchRankingProcess.java @@ -115,14 +115,12 @@ public final class plasmaSearchRankingProcess { // join and exclude the local result timer = System.currentTimeMillis(); final indexContainer index = - (this.localSearchContainerMaps == null) ? - plasmaWordIndex.emptyContainer(null, 0) : - indexContainer.joinExcludeContainers( - this.localSearchContainerMaps[0].values(), - this.localSearchContainerMaps[1].values(), - query.maxDistance); + indexContainer.joinExcludeContainers( + this.localSearchContainerMaps[0].values(), + this.localSearchContainerMaps[1].values(), + query.maxDistance); serverProfiling.update("SEARCH", new plasmaProfiling.searchEvent(query.id(true), plasmaSearchEvent.JOIN, index.size(), System.currentTimeMillis() - timer)); - if ((index == null) || (index.size() == 0)) { + if (index.size() == 0) { return; } diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java index 3f2885338..c6d2d1e76 100644 --- a/source/de/anomic/plasma/plasmaWordIndex.java +++ b/source/de/anomic/plasma/plasmaWordIndex.java @@ -424,7 +424,7 @@ public final class plasmaWordIndex implements indexRI { // flush elements that are too big. This flushing depends on the fact that the flush rule // selects the biggest elements first for flushing. If it does not for any reason, the following // loop would not terminate. - serverProfiling.update("wordcache", new Long(cs)); + serverProfiling.update("wordcache", Long.valueOf(cs)); // To ensure termination an additional counter is used int l = 0; while ((l++ < 100) && (theCache.maxURLinCache() > wCacheMaxChunk)) { @@ -435,7 +435,7 @@ public final class plasmaWordIndex implements indexRI { (serverMemory.available() < collections.minMem())) { flushCache(theCache, Math.min(theCache.size() - theCache.getMaxWordCount() + 1, theCache.size())); } - if (cacheSize() != cs) serverProfiling.update("wordcache", new Long(cacheSize())); + if (cacheSize() != cs) serverProfiling.update("wordcache", Long.valueOf(cacheSize())); } }