From 57e33cf1352ce225e1435ba08b0cfc93696bfe13 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Mon, 30 Jan 2012 22:31:51 +0000 Subject: [PATCH] LUCENE-2858: fix remaining nocommits git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene2858@1238050 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/SlowCompositeReaderWrapper.java | 2 +- .../org/apache/lucene/search/SearcherLifetimeManager.java | 2 -- .../java/org/apache/lucene/search/CheckHits.java | 3 +-- .../java/org/apache/lucene/search/QueryUtils.java | 6 +++--- .../test/org/apache/lucene/index/TestDirectoryReader.java | 2 +- .../lucene/search/grouping/AllGroupHeadsCollectorTest.java | 2 +- .../org/apache/lucene/search/grouping/TestGrouping.java | 4 ++-- 7 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lucene/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java b/lucene/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java index 171fb037a3e..d51c4392713 100644 --- a/lucene/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java +++ b/lucene/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java @@ -160,7 +160,7 @@ public final class SlowCompositeReaderWrapper extends AtomicReader { @Override protected void doClose() throws IOException { - // nocommit: as this is a wrapper, should we really close the delegate? + // TODO: as this is a wrapper, should we really close the delegate? in.close(); } } diff --git a/lucene/src/java/org/apache/lucene/search/SearcherLifetimeManager.java b/lucene/src/java/org/apache/lucene/search/SearcherLifetimeManager.java index 9e53c379ec9..4ffde2665f0 100644 --- a/lucene/src/java/org/apache/lucene/search/SearcherLifetimeManager.java +++ b/lucene/src/java/org/apache/lucene/search/SearcherLifetimeManager.java @@ -109,7 +109,6 @@ public class SearcherLifetimeManager implements Closeable { public SearcherTracker(IndexSearcher searcher) { this.searcher = searcher; - // nocommit: what happens if this is no DirectoryReader? version = ((DirectoryReader) searcher.getIndexReader()).getVersion(); searcher.getIndexReader().incRef(); // Use nanoTime not currentTimeMillis since it [in @@ -169,7 +168,6 @@ public class SearcherLifetimeManager implements Closeable { // TODO: we don't have to use IR.getVersion to track; // could be risky (if it's buggy); we could get better // bug isolation if we assign our own private ID: - // nocommit: fix getVersion() usage for atomic readers final long version = ((DirectoryReader) searcher.getIndexReader()).getVersion(); SearcherTracker tracker = searchers.get(version); if (tracker == null) { diff --git a/lucene/src/test-framework/java/org/apache/lucene/search/CheckHits.java b/lucene/src/test-framework/java/org/apache/lucene/search/CheckHits.java index 5e736313008..9cb5d655fd7 100644 --- a/lucene/src/test-framework/java/org/apache/lucene/search/CheckHits.java +++ b/lucene/src/test-framework/java/org/apache/lucene/search/CheckHits.java @@ -116,8 +116,7 @@ public class CheckHits { Assert.assertEquals("Wrap Reader " + i + ": " + query.toString(defaultFieldName), correct, actual); - // nocommit: I removed that as we can never get insanity by composite readers anymore... Is this ok? - //FieldCache.DEFAULT.purge(s.getIndexReader()); // our wrapping can create insanity otherwise + // TODO: FieldCache.DEFAULT.purge(s.getIndexReader()); // our wrapping can create insanity otherwise } } diff --git a/lucene/src/test-framework/java/org/apache/lucene/search/QueryUtils.java b/lucene/src/test-framework/java/org/apache/lucene/search/QueryUtils.java index 8d3e55e34d2..c7e8b1d6ac2 100644 --- a/lucene/src/test-framework/java/org/apache/lucene/search/QueryUtils.java +++ b/lucene/src/test-framework/java/org/apache/lucene/search/QueryUtils.java @@ -116,13 +116,13 @@ public class QueryUtils { if (wrap) { IndexSearcher wrapped; check(random, q1, wrapped = wrapUnderlyingReader(random, s, -1), false); - // nocommit: I removed that as we can never get insanity by composite readers anymore... Is this ok? + // TODO: I removed that as we can never get insanity by composite readers anymore... Is this ok? //FieldCache.DEFAULT.purge(wrapped.getIndexReader()); // our wrapping can create insanity otherwise check(random, q1, wrapped = wrapUnderlyingReader(random, s, 0), false); - // nocommit: I removed that as we can never get insanity by composite readers anymore... Is this ok? + // TODO: I removed that as we can never get insanity by composite readers anymore... Is this ok? //FieldCache.DEFAULT.purge(wrapped.getIndexReader()); // our wrapping can create insanity otherwise check(random, q1, wrapped = wrapUnderlyingReader(random, s, +1), false); - // nocommit: I removed that as we can never get insanity by composite readers anymore... Is this ok? + // TODO: I removed that as we can never get insanity by composite readers anymore... Is this ok? //FieldCache.DEFAULT.purge(wrapped.getIndexReader()); // our wrapping can create insanity otherwise } checkExplanations(q1,s); diff --git a/lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java b/lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java index 8dfed16de0a..9b6eb2b1d25 100644 --- a/lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java +++ b/lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java @@ -86,7 +86,7 @@ public class TestDirectoryReader extends LuceneTestCase { assertTrue(DocHelper.numFields(newDoc2) == DocHelper.numFields(doc2) - DocHelper.unstored.size()); Terms vector = reader.getTermVectors(0).terms(DocHelper.TEXT_FIELD_2_KEY); assertNotNull(vector); - // nocommit: pretty sure this check makes zero sense TestSegmentReader.checkNorms(reader); + // TODO: pretty sure this check makes zero sense TestSegmentReader.checkNorms(reader); reader.close(); } diff --git a/modules/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java b/modules/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java index 7ee56822142..13bd213d1fb 100644 --- a/modules/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java +++ b/modules/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java @@ -366,7 +366,7 @@ public class AllGroupHeadsCollectorTest extends LuceneTestCase { } } } finally { - // nocommit FieldCache.DEFAULT.purge(r); + // TODO: FieldCache.DEFAULT.purge(r); } r.close(); diff --git a/modules/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java b/modules/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java index 8bbbe8a74d3..aad5b4778e4 100644 --- a/modules/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java +++ b/modules/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java @@ -1140,9 +1140,9 @@ public class TestGrouping extends LuceneTestCase { assertEquals(docIDToIDBlocks, expectedGroups, topGroupsBlockShards, false, false, fillFields, getScores, false); } } finally { - // nocommit FieldCache.DEFAULT.purge(r); + // TODO: FieldCache.DEFAULT.purge(r); if (rBlocks != null) { - // nocommit FieldCache.DEFAULT.purge(rBlocks); + // TODO: FieldCache.DEFAULT.purge(rBlocks); } }