You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2020/08/24 18:29:56 UTC
[lucenenet] 09/13: Changed all Debugging.Assert() overloads to use
bool instead of Func
This is an automated email from the ASF dual-hosted git repository.
nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git
commit a758ffa4c58eb0ce6fd8f202aaee3c370e988467
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Wed Aug 19 05:37:55 2020 +0700
Changed all Debugging.Assert() overloads to use bool instead of Func<bool>
---
.../Analysis/CharFilter/BaseCharFilter.cs | 2 +-
.../Analysis/CharFilter/HTMLStripCharFilter.cs | 22 +-
.../Analysis/CharFilter/MappingCharFilter.cs | 2 +-
.../Analysis/CharFilter/NormalizeCharMap.cs | 2 +-
.../Compound/CompoundWordTokenFilterBase.cs | 2 +-
.../Analysis/Gl/GalicianStemmer.cs | 2 +-
.../Analysis/Hunspell/Dictionary.cs | 4 +-
.../Analysis/Hunspell/Stemmer.cs | 4 +-
.../Analysis/Miscellaneous/ASCIIFoldingFilter.cs | 2 +-
.../Miscellaneous/SingleTokenTokenStream.cs | 4 +-
.../Analysis/NGram/NGramTokenizer.cs | 4 +-
.../Pattern/PatternCaptureGroupTokenFilter.cs | 2 +-
.../Analysis/Pt/PortugueseStemmer.cs | 2 +-
.../Analysis/Pt/RSLPStemmerBase.cs | 2 +-
.../Analysis/Synonym/SynonymFilter.cs | 18 +-
.../Analysis/Synonym/SynonymMap.cs | 6 +-
.../Analysis/Util/CharArrayMap.cs | 2 +-
.../Analysis/Util/CharTokenizer.cs | 4 +-
.../Analysis/Util/CharacterUtils.cs | 20 +-
.../Analysis/Util/RollingCharBuffer.cs | 18 +-
.../Analysis/Util/SegmentingTokenizerBase.cs | 2 +-
.../Analysis/Util/StemmerUtil.cs | 4 +-
.../Analysis/Icu/ICUNormalizer2CharFilter.cs | 2 +-
.../Analysis/Icu/Segmentation/ICUTokenizer.cs | 2 +-
.../Icu/Segmentation/ICUTokenizerFactory.cs | 4 +-
.../Dict/TokenInfoFST.cs | 2 +-
.../GraphvizFormatter.cs | 4 +-
.../JapaneseIterationMarkCharFilter.cs | 2 +-
.../JapaneseTokenizer.cs | 36 ++--
.../Tools/BinaryDictionaryWriter.cs | 24 +--
.../Tools/ConnectionCostsBuilder.cs | 6 +-
.../Tools/ConnectionCostsWriter.cs | 4 +-
.../BeiderMorseFilter.cs | 2 +-
.../ByTask/Utils/AnalyzerFactory.cs | 2 +-
src/Lucene.Net.Benchmark/Quality/QualityStats.cs | 2 +-
src/Lucene.Net.Benchmark/Quality/Trec/TrecJudge.cs | 2 +-
.../BlockTerms/BlockTermsReader.cs | 32 +--
.../BlockTerms/BlockTermsWriter.cs | 12 +-
.../BlockTerms/FixedGapTermsIndexReader.cs | 24 +--
.../BlockTerms/FixedGapTermsIndexWriter.cs | 2 +-
.../BlockTerms/VariableGapTermsIndexReader.cs | 2 +-
.../BlockTerms/VariableGapTermsIndexWriter.cs | 2 +-
.../Bloom/BloomFilteringPostingsFormat.cs | 2 +-
src/Lucene.Net.Codecs/Bloom/FuzzySet.cs | 2 +-
.../IntBlock/FixedIntBlockIndexInput.cs | 4 +-
.../IntBlock/FixedIntBlockIndexOutput.cs | 2 +-
.../IntBlock/VariableIntBlockIndexInput.cs | 2 +-
.../IntBlock/VariableIntBlockIndexOutput.cs | 8 +-
.../Memory/DirectDocValuesConsumer.cs | 2 +-
.../Memory/DirectDocValuesProducer.cs | 2 +-
.../Memory/DirectPostingsFormat.cs | 52 ++---
src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs | 12 +-
src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs | 6 +-
src/Lucene.Net.Codecs/Memory/FSTTermsReader.cs | 8 +-
.../Memory/MemoryDocValuesConsumer.cs | 2 +-
.../Memory/MemoryDocValuesProducer.cs | 2 +-
.../Memory/MemoryPostingsFormat.cs | 24 +--
.../Pulsing/PulsingPostingsFormat.cs | 2 +-
.../Pulsing/PulsingPostingsReader.cs | 10 +-
.../Pulsing/PulsingPostingsWriter.cs | 20 +-
src/Lucene.Net.Codecs/Sep/SepPostingsReader.cs | 10 +-
src/Lucene.Net.Codecs/Sep/SepPostingsWriter.cs | 8 +-
src/Lucene.Net.Codecs/Sep/SepSkipListReader.cs | 2 +-
src/Lucene.Net.Codecs/Sep/SepSkipListWriter.cs | 2 +-
.../SimpleText/SimpleTextDocValuesReader.cs | 42 ++--
.../SimpleText/SimpleTextDocValuesWriter.cs | 38 ++--
.../SimpleText/SimpleTextFieldInfosReader.cs | 28 +--
.../SimpleText/SimpleTextFieldInfosWriter.cs | 2 +-
.../SimpleText/SimpleTextFieldsReader.cs | 13 +-
.../SimpleText/SimpleTextFieldsWriter.cs | 6 +-
.../SimpleText/SimpleTextLiveDocsFormat.cs | 6 +-
.../SimpleText/SimpleTextSegmentInfoReader.cs | 16 +-
.../SimpleText/SimpleTextStoredFieldsReader.cs | 14 +-
.../SimpleText/SimpleTextTermVectorsReader.cs | 34 ++--
.../SimpleText/SimpleTextTermVectorsWriter.cs | 4 +-
src/Lucene.Net.Expressions/ExpressionComparator.cs | 4 +-
src/Lucene.Net.Expressions/ScoreFunctionValues.cs | 2 +-
src/Lucene.Net.Facet/DrillDownQuery.cs | 2 +-
src/Lucene.Net.Facet/DrillSideways.cs | 2 +-
src/Lucene.Net.Facet/DrillSidewaysScorer.cs | 6 +-
src/Lucene.Net.Facet/FacetsConfig.cs | 2 +-
src/Lucene.Net.Facet/Range/LongRangeCounter.cs | 10 +-
src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs | 4 +-
.../Taxonomy/Directory/DirectoryTaxonomyWriter.cs | 6 +-
.../Taxonomy/Directory/TaxonomyIndexArrays.cs | 2 +-
src/Lucene.Net.Facet/Taxonomy/FacetLabel.cs | 2 +-
.../Taxonomy/FloatTaxonomyFacets.cs | 2 +-
src/Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs | 2 +-
.../AbstractFirstPassGroupingCollector.cs | 10 +-
src/Lucene.Net.Grouping/BlockGroupingCollector.cs | 8 +-
src/Lucene.Net.Grouping/SearchGroup.cs | 10 +-
.../Term/TermGroupFacetCollector.cs | 4 +-
.../PostingsHighlight/MultiTermHighlighting.cs | 4 +-
.../PostingsHighlight/Passage.cs | 4 +-
.../PostingsHighlight/PostingsHighlighter.cs | 16 +-
.../VectorHighlight/BaseFragListBuilder.cs | 2 +-
.../VectorHighlight/FieldTermStack.cs | 2 +-
src/Lucene.Net.Join/ToChildBlockJoinQuery.cs | 10 +-
src/Lucene.Net.Join/ToParentBlockJoinCollector.cs | 4 +-
src/Lucene.Net.Join/ToParentBlockJoinQuery.cs | 4 +-
.../MemoryIndex.MemoryIndexReader.cs | 10 +-
src/Lucene.Net.Memory/MemoryIndex.cs | 14 +-
src/Lucene.Net.Misc/Document/LazyDocument.cs | 6 +-
.../Index/MultiPassIndexSplitter.cs | 2 +-
src/Lucene.Net.Misc/Index/PKIndexSplitter.cs | 2 +-
src/Lucene.Net.Misc/Index/Sorter/Sorter.cs | 4 +-
.../Index/Sorter/SortingAtomicReader.cs | 2 +-
.../Index/Sorter/SortingMergePolicy.cs | 2 +-
src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs | 4 +-
.../Util/Fst/UpToTwoPositiveIntOutputs.cs | 36 ++--
src/Lucene.Net.Queries/BooleanFilter.cs | 2 +-
src/Lucene.Net.Queries/CommonTermsQuery.cs | 2 +-
.../Processors/AnalyzerQueryNodeProcessor.cs | 10 +-
.../Simple/SimpleQueryParser.cs | 4 +-
.../IndexAndTaxonomyRevision.cs | 2 +-
src/Lucene.Net.Replicator/IndexRevision.cs | 2 +-
src/Lucene.Net.Replicator/ReplicationClient.cs | 4 +-
.../Queries/SortedSetSortField.cs | 2 +-
.../Prefix/AbstractPrefixTreeFilter.cs | 2 +-
.../Prefix/AbstractVisitingPrefixTreeFilter.cs | 16 +-
.../Prefix/ContainsPrefixTreeFilter.cs | 12 +-
src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs | 4 +-
.../Prefix/Tree/QuadPrefixTree.cs | 4 +-
.../Prefix/Tree/SpatialPrefixTree.cs | 4 +-
.../Prefix/WithinPrefixTreeFilter.cs | 4 +-
.../Vector/DistanceValueSource.cs | 2 +-
.../Suggest/Analyzing/AnalyzingSuggester.cs | 20 +-
.../Suggest/Analyzing/BlendedInfixSuggester.cs | 2 +-
.../Suggest/Analyzing/FSTUtil.cs | 8 +-
.../Suggest/Analyzing/FreeTextSuggester.cs | 14 +-
.../Suggest/Analyzing/SuggestStopFilter.cs | 2 +-
.../Suggest/Fst/FSTCompletion.cs | 2 +-
.../Suggest/Fst/WFSTCompletionLookup.cs | 8 +-
.../Suggest/UnsortedInputIterator.cs | 6 +-
.../Analysis/LookaheadTokenFilter.cs | 22 +-
.../Analysis/MockCharFilter.cs | 2 +-
.../Analysis/MockReaderWrapper.cs | 6 +-
.../Analysis/MockTokenizer.cs | 16 +-
.../Codecs/Asserting/AssertingDocValuesFormat.cs | 82 ++++----
.../Codecs/Asserting/AssertingNormsFormat.cs | 6 +-
.../Codecs/Asserting/AssertingPostingsFormat.cs | 68 +++----
.../Asserting/AssertingStoredFieldsFormat.cs | 20 +-
.../Codecs/Asserting/AssertingTermVectorsFormat.cs | 46 ++---
.../Compressing/Dummy/DummyCompressingCodec.cs | 2 +-
.../Codecs/Lucene3x/PreFlexRWFieldInfosWriter.cs | 4 +-
.../Codecs/Lucene3x/PreFlexRWFieldsWriter.cs | 10 +-
.../Codecs/Lucene3x/PreFlexRWNormsConsumer.cs | 2 +-
.../Codecs/Lucene3x/PreFlexRWStoredFieldsWriter.cs | 4 +-
.../Codecs/Lucene3x/PreFlexRWTermVectorsWriter.cs | 6 +-
.../Codecs/Lucene3x/TermInfosWriter.cs | 12 +-
.../Codecs/Lucene40/Lucene40DocValuesWriter.cs | 16 +-
.../Codecs/Lucene40/Lucene40FieldInfosWriter.cs | 8 +-
.../Codecs/Lucene40/Lucene40PostingsWriter.cs | 16 +-
.../Codecs/Lucene40/Lucene40SkipListWriter.cs | 8 +-
.../Codecs/Lucene42/Lucene42DocValuesConsumer.cs | 2 +-
.../Codecs/Lucene42/Lucene42FieldInfosWriter.cs | 4 +-
.../MockVariableIntBlockPostingsFormat.cs | 2 +-
.../Codecs/MockRandom/MockRandomPostingsFormat.cs | 2 +-
.../Codecs/RAMOnly/RAMOnlyPostingsFormat.cs | 10 +-
.../Index/AllDeletedFilterReader.cs | 2 +-
.../Index/AssertingAtomicReader.cs | 222 ++++++++++-----------
.../Index/BaseDocValuesFormatTestCase.cs | 64 +++---
.../Index/BasePostingsFormatTestCase.cs | 2 +-
.../Index/MockRandomMergePolicy.cs | 2 +-
src/Lucene.Net.TestFramework/Index/RandomCodec.cs | 4 +-
.../Index/RandomDocumentsWriterPerThreadPool.cs | 8 +-
.../Index/RandomIndexWriter.cs | 2 +-
.../Index/ThreadedIndexingAndSearchingTestCase.cs | 4 +-
.../Search/AssertingBulkScorer.cs | 2 +-
.../Search/AssertingCollector.cs | 2 +-
.../Search/AssertingScorer.cs | 8 +-
src/Lucene.Net.TestFramework/Search/QueryUtils.cs | 4 +-
.../Search/RandomSimilarityProvider.cs | 2 +-
.../Search/ShardSearchingTestBase.cs | 20 +-
.../Store/MockDirectoryWrapper.cs | 6 +-
.../Support/JavaCompatibility/LuceneTestCase.cs | 2 +-
.../Util/Automaton/AutomatonTestUtil.cs | 4 +-
.../Util/BaseDocIdSetTestCase.cs | 2 +-
.../Util/FailOnNonBulkMergesInfoStream.cs | 2 +-
src/Lucene.Net.TestFramework/Util/Fst/FSTTester.cs | 8 +-
.../Util/LuceneTestCase.cs | 14 +-
.../Util/NullInfoStream.cs | 6 +-
.../Util/TestRuleSetupAndRestoreClassEnv.cs | 14 +-
.../Util/ThrottledIndexOutput.cs | 2 +-
.../Analysis/CharFilters/TestMappingCharFilter.cs | 2 +-
.../Analysis/Core/TestFactories.cs | 2 +-
.../Analysis/Core/TestRandomChains.cs | 4 +-
.../Analysis/Hunspell/TestAllDictionaries.cs | 12 +-
.../Analysis/Hunspell/TestAllDictionaries2.cs | 12 +-
.../Analysis/Synonym/TestSynonymMapFilter.cs | 2 +-
src/Lucene.Net.Tests.Facet/FacetTestCase.cs | 2 +-
.../Range/TestRangeFacetCounts.cs | 2 +-
.../Taxonomy/TestTaxonomyFacetSumValueSource.cs | 2 +-
src/Lucene.Net.Tests.Facet/TestDrillSideways.cs | 6 +-
.../GroupFacetCollectorTest.cs | 4 +-
.../PostingsHighlight/TestPostingsHighlighter.cs | 6 +-
src/Lucene.Net.Tests.Join/TestJoinUtil.cs | 2 +-
.../Classic/TestQueryParser.cs | 14 +-
.../Flexible/Standard/TestStandardQP.cs | 10 +-
.../IndexAndTaxonomyReplicationClientTest.cs | 2 +-
.../IndexReplicationClientTest.cs | 2 +-
src/Lucene.Net.Tests.Spatial/SpatialTestCase.cs | 6 +-
.../Suggest/Analyzing/AnalyzingSuggesterTest.cs | 2 +-
.../Suggest/Analyzing/FuzzySuggesterTest.cs | 4 +-
.../Suggest/Analyzing/TestFreeTextSuggester.cs | 2 +-
.../Suggest/LookupBenchmarkTest.cs | 4 +-
.../Analysis/TestGraphTokenizers.cs | 2 +-
.../Codecs/Lucene41/TestBlockPostingsFormat3.cs | 2 +-
.../Codecs/PerField/TestPerFieldDocValuesFormat.cs | 2 +-
.../Index/TestBackwardsCompatibility.cs | 2 +-
.../Index/TestBackwardsCompatibility3x.cs | 2 +-
src/Lucene.Net.Tests/Index/TestCodecs.cs | 6 +-
src/Lucene.Net.Tests/Index/TestIndexWriter.cs | 4 +-
.../Index/TestIndexWriterMerging.cs | 2 +-
src/Lucene.Net.Tests/Index/TestIndexableField.cs | 4 +-
src/Lucene.Net.Tests/Index/TestLongPostings.cs | 4 +-
src/Lucene.Net.Tests/Index/TestNRTThreads.cs | 2 +-
src/Lucene.Net.Tests/Index/TestPayloads.cs | 2 +-
.../Index/TestPayloadsOnVectors.cs | 4 +-
src/Lucene.Net.Tests/Index/TestPostingsOffsets.cs | 8 +-
src/Lucene.Net.Tests/Index/TestStressIndexing2.cs | 4 +-
src/Lucene.Net.Tests/Index/TestStressNRT.cs | 4 +-
src/Lucene.Net.Tests/Index/TestTermsEnum.cs | 2 +-
.../Search/Spans/MultiSpansWrapper.cs | 2 +-
src/Lucene.Net.Tests/Search/TestBooleanScorer.cs | 2 +-
.../Search/TestConstantScoreQuery.cs | 2 +-
src/Lucene.Net.Tests/Search/TestFieldCache.cs | 2 +-
src/Lucene.Net.Tests/Search/TestMinShouldMatch2.cs | 10 +-
.../Search/TestMultiThreadTermVectors.cs | 2 +-
.../Search/TestNumericRangeQuery32.cs | 4 +-
.../Search/TestNumericRangeQuery64.cs | 4 +-
.../Search/TestTimeLimitingCollector.cs | 2 +-
.../Util/Automaton/TestUTF32ToUTF8.cs | 6 +-
src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs | 2 +-
.../Util/Packed/TestEliasFanoDocIdSet.cs | 2 +-
.../Util/Packed/TestEliasFanoSequence.cs | 6 +-
src/Lucene.Net.Tests/Util/Test2BPagedBytes.cs | 2 +-
src/Lucene.Net.Tests/Util/TestWAH8DocIdSet.cs | 2 +-
src/Lucene.Net/Analysis/NumericTokenStream.cs | 2 +-
src/Lucene.Net/Analysis/TokenStreamToAutomaton.cs | 4 +-
src/Lucene.Net/Analysis/Tokenizer.cs | 2 +-
src/Lucene.Net/Codecs/BlockTermState.cs | 2 +-
src/Lucene.Net/Codecs/BlockTreeTermsReader.cs | 162 +++++++--------
src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs | 66 +++---
src/Lucene.Net/Codecs/CodecUtil.cs | 2 +-
.../CompressingStoredFieldsIndexWriter.cs | 8 +-
.../Compressing/CompressingStoredFieldsReader.cs | 18 +-
.../Compressing/CompressingStoredFieldsWriter.cs | 16 +-
.../Compressing/CompressingTermVectorsReader.cs | 20 +-
.../Compressing/CompressingTermVectorsWriter.cs | 38 ++--
.../Codecs/Compressing/CompressionMode.cs | 6 +-
src/Lucene.Net/Codecs/Compressing/LZ4.cs | 18 +-
src/Lucene.Net/Codecs/DocValuesConsumer.cs | 4 +-
src/Lucene.Net/Codecs/FieldsConsumer.cs | 2 +-
src/Lucene.Net/Codecs/Lucene3x/Lucene3xFields.cs | 40 ++--
.../Codecs/Lucene3x/Lucene3xNormsProducer.cs | 6 +-
.../Codecs/Lucene3x/Lucene3xSegmentInfoReader.cs | 6 +-
.../Codecs/Lucene3x/Lucene3xStoredFieldsReader.cs | 4 +-
.../Codecs/Lucene3x/Lucene3xTermVectorsReader.cs | 14 +-
src/Lucene.Net/Codecs/Lucene3x/SegmentTermDocs.cs | 2 +-
src/Lucene.Net/Codecs/Lucene3x/SegmentTermEnum.cs | 4 +-
.../Codecs/Lucene3x/SegmentTermPositions.cs | 2 +-
src/Lucene.Net/Codecs/Lucene3x/TermBuffer.cs | 6 +-
src/Lucene.Net/Codecs/Lucene3x/TermInfosReader.cs | 10 +-
src/Lucene.Net/Codecs/Lucene40/BitVector.cs | 24 +--
.../Codecs/Lucene40/Lucene40LiveDocsFormat.cs | 8 +-
.../Codecs/Lucene40/Lucene40PostingsFormat.cs | 2 +-
.../Codecs/Lucene40/Lucene40PostingsReader.cs | 36 ++--
.../Codecs/Lucene40/Lucene40StoredFieldsReader.cs | 8 +-
.../Codecs/Lucene40/Lucene40StoredFieldsWriter.cs | 10 +-
.../Codecs/Lucene40/Lucene40TermVectorsReader.cs | 24 +--
.../Codecs/Lucene40/Lucene40TermVectorsWriter.cs | 18 +-
src/Lucene.Net/Codecs/Lucene41/ForUtil.cs | 22 +-
.../Codecs/Lucene41/Lucene41PostingsFormat.cs | 4 +-
.../Codecs/Lucene41/Lucene41PostingsReader.cs | 22 +-
.../Codecs/Lucene41/Lucene41PostingsWriter.cs | 12 +-
.../Codecs/Lucene41/Lucene41SkipReader.cs | 2 +-
.../Codecs/Lucene42/Lucene42NormsConsumer.cs | 4 +-
.../Codecs/Lucene45/Lucene45DocValuesConsumer.cs | 4 +-
.../Codecs/Lucene46/Lucene46FieldInfosWriter.cs | 4 +-
src/Lucene.Net/Codecs/MappingMultiDocsEnum.cs | 2 +-
src/Lucene.Net/Codecs/MultiLevelSkipListReader.cs | 2 +-
src/Lucene.Net/Codecs/MultiLevelSkipListWriter.cs | 2 +-
.../Codecs/PerField/PerFieldDocValuesFormat.cs | 10 +-
.../Codecs/PerField/PerFieldPostingsFormat.cs | 8 +-
src/Lucene.Net/Codecs/PostingsConsumer.cs | 2 +-
src/Lucene.Net/Codecs/TermVectorsWriter.cs | 16 +-
src/Lucene.Net/Codecs/TermsConsumer.cs | 10 +-
src/Lucene.Net/Index/AtomicReader.cs | 8 +-
src/Lucene.Net/Index/AtomicReaderContext.cs | 2 +-
src/Lucene.Net/Index/AutomatonTermsEnum.cs | 8 +-
src/Lucene.Net/Index/BitsSlice.cs | 4 +-
src/Lucene.Net/Index/BufferedUpdatesStream.cs | 48 ++---
src/Lucene.Net/Index/ByteSliceReader.cs | 16 +-
src/Lucene.Net/Index/ByteSliceWriter.cs | 12 +-
src/Lucene.Net/Index/CheckIndex.cs | 28 +--
src/Lucene.Net/Index/CompositeReader.cs | 4 +-
src/Lucene.Net/Index/CompositeReaderContext.cs | 4 +-
src/Lucene.Net/Index/ConcurrentMergeScheduler.cs | 2 +-
src/Lucene.Net/Index/DirectoryReader.cs | 6 +-
src/Lucene.Net/Index/DocFieldProcessor.cs | 8 +-
src/Lucene.Net/Index/DocTermOrds.cs | 20 +-
src/Lucene.Net/Index/DocValuesFieldUpdates.cs | 4 +-
src/Lucene.Net/Index/DocValuesProcessor.cs | 4 +-
src/Lucene.Net/Index/DocumentsWriter.cs | 38 ++--
src/Lucene.Net/Index/DocumentsWriterDeleteQueue.cs | 6 +-
.../Index/DocumentsWriterFlushControl.cs | 72 +++----
src/Lucene.Net/Index/DocumentsWriterFlushQueue.cs | 34 ++--
src/Lucene.Net/Index/DocumentsWriterPerThread.cs | 30 +--
.../Index/DocumentsWriterPerThreadPool.cs | 24 +--
.../Index/DocumentsWriterStallControl.cs | 8 +-
src/Lucene.Net/Index/FieldInfo.cs | 28 +--
src/Lucene.Net/Index/FieldInfos.cs | 10 +-
src/Lucene.Net/Index/FilteredTermsEnum.cs | 6 +-
src/Lucene.Net/Index/FlushPolicy.cs | 6 +-
src/Lucene.Net/Index/FreqProxTermsWriter.cs | 2 +-
.../Index/FreqProxTermsWriterPerField.cs | 48 ++---
src/Lucene.Net/Index/FrozenBufferedUpdates.cs | 6 +-
src/Lucene.Net/Index/IndexFileDeleter.cs | 42 ++--
src/Lucene.Net/Index/IndexFileNames.cs | 4 +-
src/Lucene.Net/Index/IndexFormatTooNewException.cs | 2 +-
src/Lucene.Net/Index/IndexFormatTooOldException.cs | 4 +-
src/Lucene.Net/Index/IndexWriter.cs | 146 +++++++-------
src/Lucene.Net/Index/LogMergePolicy.cs | 8 +-
src/Lucene.Net/Index/MergePolicy.cs | 8 +-
src/Lucene.Net/Index/MergeState.cs | 4 +-
src/Lucene.Net/Index/MultiBits.cs | 12 +-
src/Lucene.Net/Index/MultiDocValues.cs | 10 +-
src/Lucene.Net/Index/MultiDocsAndPositionsEnum.cs | 4 +-
src/Lucene.Net/Index/MultiDocsEnum.cs | 2 +-
src/Lucene.Net/Index/MultiFields.cs | 10 +-
src/Lucene.Net/Index/MultiTerms.cs | 2 +-
src/Lucene.Net/Index/MultiTermsEnum.cs | 20 +-
src/Lucene.Net/Index/NormsConsumer.cs | 6 +-
.../Index/NumericDocValuesFieldUpdates.cs | 2 +-
src/Lucene.Net/Index/OrdTermState.cs | 2 +-
src/Lucene.Net/Index/ParallelCompositeReader.cs | 2 +-
src/Lucene.Net/Index/PrefixCodedTerms.cs | 4 +-
src/Lucene.Net/Index/ReadersAndUpdates.cs | 48 ++---
src/Lucene.Net/Index/SegmentCoreReaders.cs | 6 +-
src/Lucene.Net/Index/SegmentDocValues.cs | 4 +-
src/Lucene.Net/Index/SegmentInfo.cs | 4 +-
src/Lucene.Net/Index/SegmentInfos.cs | 10 +-
src/Lucene.Net/Index/SegmentMerger.cs | 4 +-
src/Lucene.Net/Index/SegmentReader.cs | 12 +-
src/Lucene.Net/Index/SimpleMergedSegmentWarmer.cs | 2 +-
.../Index/SingletonSortedSetDocValues.cs | 2 +-
src/Lucene.Net/Index/SlowCompositeReaderWrapper.cs | 4 +-
src/Lucene.Net/Index/SnapshotDeletionPolicy.cs | 2 +-
src/Lucene.Net/Index/SortedDocValuesTermsEnum.cs | 4 +-
src/Lucene.Net/Index/SortedDocValuesWriter.cs | 4 +-
.../Index/SortedSetDocValuesTermsEnum.cs | 4 +-
src/Lucene.Net/Index/SortedSetDocValuesWriter.cs | 4 +-
src/Lucene.Net/Index/StandardDirectoryReader.cs | 6 +-
src/Lucene.Net/Index/StoredFieldsProcessor.cs | 6 +-
src/Lucene.Net/Index/TermContext.cs | 12 +-
src/Lucene.Net/Index/TermVectorsConsumer.cs | 12 +-
.../Index/TermVectorsConsumerPerField.cs | 12 +-
src/Lucene.Net/Index/TermsHashPerField.cs | 6 +-
.../ThreadAffinityDocumentsWriterThreadPool.cs | 6 +-
src/Lucene.Net/Search/CachingWrapperFilter.cs | 2 +-
src/Lucene.Net/Search/CollectionStatistics.cs | 8 +-
src/Lucene.Net/Search/ConstantScoreAutoRewrite.cs | 6 +-
src/Lucene.Net/Search/ConstantScoreQuery.cs | 12 +-
src/Lucene.Net/Search/DisjunctionScorer.cs | 4 +-
src/Lucene.Net/Search/DocIdSetIterator.cs | 8 +-
src/Lucene.Net/Search/DocTermOrdsRangeFilter.cs | 2 +-
src/Lucene.Net/Search/DocTermOrdsRewriteMethod.cs | 2 +-
src/Lucene.Net/Search/ExactPhraseScorer.cs | 2 +-
src/Lucene.Net/Search/FieldCacheImpl.cs | 12 +-
src/Lucene.Net/Search/FieldCacheRangeFilter.cs | 4 +-
src/Lucene.Net/Search/FieldCacheRewriteMethod.cs | 2 +-
src/Lucene.Net/Search/FieldComparator.cs | 12 +-
src/Lucene.Net/Search/FieldValueHitQueue.cs | 8 +-
src/Lucene.Net/Search/FilteredQuery.cs | 8 +-
src/Lucene.Net/Search/FuzzyTermsEnum.cs | 2 +-
src/Lucene.Net/Search/IndexSearcher.cs | 6 +-
src/Lucene.Net/Search/MinShouldMatchSumScorer.cs | 4 +-
src/Lucene.Net/Search/MultiPhraseQuery.cs | 4 +-
.../Search/MultiTermQueryWrapperFilter.cs | 2 +-
src/Lucene.Net/Search/NumericRangeQuery.cs | 14 +-
src/Lucene.Net/Search/PhraseQuery.cs | 6 +-
src/Lucene.Net/Search/QueryRescorer.cs | 2 +-
src/Lucene.Net/Search/ReferenceManager.cs | 6 +-
src/Lucene.Net/Search/ReqOptSumScorer.cs | 4 +-
src/Lucene.Net/Search/ScoringRewrite.cs | 10 +-
src/Lucene.Net/Search/SearcherManager.cs | 4 +-
.../Search/Similarities/SimilarityBase.cs | 2 +-
src/Lucene.Net/Search/SloppyPhraseScorer.cs | 4 +-
src/Lucene.Net/Search/SortField.cs | 2 +-
src/Lucene.Net/Search/SortRescorer.cs | 2 +-
src/Lucene.Net/Search/Spans/NearSpansOrdered.cs | 6 +-
src/Lucene.Net/Search/Spans/SpanFirstQuery.cs | 2 +-
.../Search/Spans/SpanPositionRangeQuery.cs | 2 +-
src/Lucene.Net/Search/Spans/TermSpans.cs | 2 +-
src/Lucene.Net/Search/TermCollectingRewrite.cs | 2 +-
src/Lucene.Net/Search/TermQuery.cs | 10 +-
src/Lucene.Net/Search/TermScorer.cs | 2 +-
src/Lucene.Net/Search/TermStatistics.cs | 4 +-
src/Lucene.Net/Search/TopDocs.cs | 10 +-
src/Lucene.Net/Search/TopScoreDocCollector.cs | 12 +-
src/Lucene.Net/Search/TopTermsRewrite.cs | 18 +-
src/Lucene.Net/Store/BaseDirectory.cs | 2 +-
src/Lucene.Net/Store/BufferedIndexInput.cs | 2 +-
src/Lucene.Net/Store/ByteArrayDataOutput.cs | 4 +-
src/Lucene.Net/Store/ByteBufferIndexInput.cs | 8 +-
src/Lucene.Net/Store/CompoundFileDirectory.cs | 8 +-
src/Lucene.Net/Store/CompoundFileWriter.cs | 18 +-
src/Lucene.Net/Store/DataInput.cs | 2 +-
src/Lucene.Net/Store/DataOutput.cs | 4 +-
src/Lucene.Net/Store/IOContext.cs | 6 +-
src/Lucene.Net/Store/MMapDirectory.cs | 2 +-
src/Lucene.Net/Store/NIOFSDirectory.cs | 6 +-
src/Lucene.Net/Store/RAMOutputStream.cs | 2 +-
src/Lucene.Net/Store/SimpleFSDirectory.cs | 2 +-
src/Lucene.Net/Support/Collections.cs | 2 +-
src/Lucene.Net/Support/Diagnostics/Debugging.cs | 65 +++---
src/Lucene.Net/Util/ArrayUtil.cs | 40 ++--
src/Lucene.Net/Util/AttributeSource.cs | 2 +-
src/Lucene.Net/Util/Automaton/Automaton.cs | 4 +-
src/Lucene.Net/Util/Automaton/BasicOperations.cs | 8 +-
src/Lucene.Net/Util/Automaton/CompiledAutomaton.cs | 8 +-
.../Util/Automaton/DaciukMihovAutomatonBuilder.cs | 14 +-
.../Util/Automaton/Lev1ParametricDescription.cs | 4 +-
.../Util/Automaton/Lev1TParametricDescription.cs | 4 +-
.../Util/Automaton/Lev2ParametricDescription.cs | 4 +-
.../Util/Automaton/Lev2TParametricDescription.cs | 4 +-
.../Util/Automaton/LevenshteinAutomata.cs | 2 +-
src/Lucene.Net/Util/Automaton/SortedIntSet.cs | 2 +-
src/Lucene.Net/Util/Automaton/State.cs | 2 +-
src/Lucene.Net/Util/Automaton/Transition.cs | 6 +-
src/Lucene.Net/Util/Automaton/UTF32ToUTF8.cs | 4 +-
src/Lucene.Net/Util/BroadWord.cs | 4 +-
src/Lucene.Net/Util/ByteBlockPool.cs | 2 +-
src/Lucene.Net/Util/BytesRef.cs | 12 +-
src/Lucene.Net/Util/BytesRefArray.cs | 2 +-
src/Lucene.Net/Util/BytesRefHash.cs | 38 ++--
src/Lucene.Net/Util/CharsRef.cs | 4 +-
src/Lucene.Net/Util/FilterIterator.cs | 2 +-
src/Lucene.Net/Util/FixedBitSet.cs | 30 +--
src/Lucene.Net/Util/Fst/Builder.cs | 44 ++--
src/Lucene.Net/Util/Fst/ByteSequenceOutputs.cs | 22 +-
src/Lucene.Net/Util/Fst/BytesRefFSTEnum.cs | 2 +-
src/Lucene.Net/Util/Fst/BytesStore.cs | 18 +-
src/Lucene.Net/Util/Fst/CharSequenceOutputs.cs | 22 +-
src/Lucene.Net/Util/Fst/FST.cs | 76 +++----
src/Lucene.Net/Util/Fst/FSTEnum.cs | 20 +-
src/Lucene.Net/Util/Fst/IntSequenceOutputs.cs | 22 +-
src/Lucene.Net/Util/Fst/IntsRefFSTEnum.cs | 2 +-
src/Lucene.Net/Util/Fst/NoOutputs.cs | 16 +-
src/Lucene.Net/Util/Fst/NodeHash.cs | 2 +-
src/Lucene.Net/Util/Fst/PairOutputs.cs | 18 +-
src/Lucene.Net/Util/Fst/PositiveIntOutputs.cs | 24 +--
src/Lucene.Net/Util/Fst/Util.cs | 12 +-
src/Lucene.Net/Util/IndexableBinaryStringTools.cs | 4 +-
src/Lucene.Net/Util/InfoStream.cs | 2 +-
src/Lucene.Net/Util/IntBlockPool.cs | 14 +-
src/Lucene.Net/Util/IntsRef.cs | 4 +-
src/Lucene.Net/Util/LongBitSet.cs | 30 +--
src/Lucene.Net/Util/LongsRef.cs | 4 +-
src/Lucene.Net/Util/MergedIterator.cs | 2 +-
src/Lucene.Net/Util/OfflineSorter.cs | 12 +-
src/Lucene.Net/Util/OpenBitSet.cs | 34 ++--
src/Lucene.Net/Util/PForDeltaDocIdSet.cs | 28 +--
.../Util/Packed/AbstractAppendingLongBuffer.cs | 10 +-
.../Util/Packed/AbstractBlockPackedWriter.cs | 2 +-
src/Lucene.Net/Util/Packed/AbstractPagedMutable.cs | 6 +-
src/Lucene.Net/Util/Packed/BlockPackedReader.cs | 2 +-
.../Util/Packed/BlockPackedReaderIterator.cs | 12 +-
src/Lucene.Net/Util/Packed/BlockPackedWriter.cs | 2 +-
src/Lucene.Net/Util/Packed/BulkOperation.cs | 4 +-
src/Lucene.Net/Util/Packed/BulkOperationPacked.cs | 16 +-
src/Lucene.Net/Util/Packed/Direct16.cs | 14 +-
src/Lucene.Net/Util/Packed/Direct32.cs | 14 +-
src/Lucene.Net/Util/Packed/Direct64.cs | 12 +-
src/Lucene.Net/Util/Packed/Direct8.cs | 14 +-
src/Lucene.Net/Util/Packed/EliasFanoDecoder.cs | 28 +--
src/Lucene.Net/Util/Packed/EliasFanoEncoder.cs | 4 +-
src/Lucene.Net/Util/Packed/GrowableWriter.cs | 2 +-
.../Util/Packed/MonotonicAppendingLongBuffer.cs | 2 +-
.../Util/Packed/MonotonicBlockPackedReader.cs | 2 +-
.../Util/Packed/MonotonicBlockPackedWriter.cs | 4 +-
src/Lucene.Net/Util/Packed/Packed16ThreeBlocks.cs | 12 +-
src/Lucene.Net/Util/Packed/Packed64.cs | 36 ++--
src/Lucene.Net/Util/Packed/Packed64SingleBlock.cs | 40 ++--
src/Lucene.Net/Util/Packed/Packed8ThreeBlocks.cs | 12 +-
src/Lucene.Net/Util/Packed/PackedDataInput.cs | 2 +-
src/Lucene.Net/Util/Packed/PackedDataOutput.cs | 2 +-
src/Lucene.Net/Util/Packed/PackedInts.cs | 70 +++----
src/Lucene.Net/Util/Packed/PackedReaderIterator.cs | 8 +-
src/Lucene.Net/Util/Packed/PackedWriter.cs | 6 +-
src/Lucene.Net/Util/Packed/PagedMutable.cs | 2 +-
src/Lucene.Net/Util/PagedBytes.cs | 14 +-
src/Lucene.Net/Util/QueryBuilder.cs | 12 +-
src/Lucene.Net/Util/RamUsageEstimator.cs | 12 +-
src/Lucene.Net/Util/RecyclingByteBlockAllocator.cs | 6 +-
src/Lucene.Net/Util/RecyclingIntBlockAllocator.cs | 6 +-
src/Lucene.Net/Util/RollingBuffer.cs | 6 +-
src/Lucene.Net/Util/SentinelIntSet.cs | 4 +-
src/Lucene.Net/Util/Sorter.cs | 2 +-
src/Lucene.Net/Util/TimSorter.cs | 18 +-
src/Lucene.Net/Util/UnicodeUtil.cs | 4 +-
src/Lucene.Net/Util/WAH8DocIdSet.cs | 54 ++---
.../TestICUPostingsHighlighter.cs | 6 +-
504 files changed, 2598 insertions(+), 2598 deletions(-)
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/BaseCharFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/BaseCharFilter.cs
index f490dc0..f566eef 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/BaseCharFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/BaseCharFilter.cs
@@ -114,7 +114,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
int offset = offsets[(size == 0) ? 0 : size - 1];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => size == 0 || off >= offset,
+ if (Debugging.AssertsEnabled) Debugging.Assert(size == 0 || off >= offset,
() => "Offset #" + size + "(" + off + ") is less than the last recorded offset " + offset + "\n" + Arrays.ToString(offsets) + "\n" + Arrays.ToString(diffs));
if (size == 0 || off != offsets[size - 1])
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/HTMLStripCharFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/HTMLStripCharFilter.cs
index 611e72b..5bff511 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/HTMLStripCharFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/HTMLStripCharFilter.cs
@@ -30953,7 +30953,7 @@ namespace Lucene.Net.Analysis.CharFilters
/// </summary>
internal int NextChar()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !IsRead, () => "Attempting to read past the end of a segment.");
+ if (Debugging.AssertsEnabled) Debugging.Assert(!IsRead, () => "Attempting to read past the end of a segment.");
return m_buf[pos++];
}
@@ -31378,7 +31378,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
catch (Exception /*e*/)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "Exception parsing code point '" + decimalCharRef + "'");
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "Exception parsing code point '" + decimalCharRef + "'");
}
if (codePoint <= 0x10FFFF)
{
@@ -31638,7 +31638,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
catch (Exception /*e*/)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "Exception parsing hex code point '" + hexCharRef + "'");
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "Exception parsing hex code point '" + hexCharRef + "'");
}
if (codePoint <= 0x10FFFF)
{
@@ -31901,7 +31901,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
catch (Exception /*e*/)
{ // should never happen
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "Exception parsing high surrogate '"
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "Exception parsing high surrogate '"
+ surrogatePair.Substring(2, 6 - 2) + "'");
}
try
@@ -31910,7 +31910,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
catch (Exception /*e*/)
{ // should never happen
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "Exception parsing low surrogate '" + surrogatePair.Substring(10, 14 - 10) + "'");
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "Exception parsing low surrogate '" + surrogatePair.Substring(10, 14 - 10) + "'");
}
// add (previously matched input length) + (this match length) - (substitution length)
cumulativeDiff += inputSegment.Length + YyLength - 2;
@@ -31932,7 +31932,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
catch (Exception /*e*/)
{ // should never happen
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "Exception parsing high surrogate '"
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "Exception parsing high surrogate '"
+ surrogatePair.Substring(2, 6 - 2) + "'");
}
try
@@ -31941,7 +31941,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
catch (Exception /*e*/)
{ // should never happen
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "Exception parsing low surrogate '"
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "Exception parsing low surrogate '"
+ surrogatePair.Substring(9, 14 - 9) + "'");
}
if (char.IsLowSurrogate(lowSurrogate))
@@ -31973,7 +31973,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
catch (Exception /*e*/)
{ // should never happen
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "Exception parsing high surrogate '"
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "Exception parsing high surrogate '"
+ surrogatePair.Substring(1, 6 - 1) + "'");
}
if (char.IsHighSurrogate(highSurrogate))
@@ -31986,7 +31986,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
catch (Exception /*e*/)
{ // should never happen
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "Exception parsing low surrogate '"
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "Exception parsing low surrogate '"
+ surrogatePair.Substring(10, 14 - 10) + "'");
}
// add (previously matched input length) + (this match length) - (substitution length)
@@ -32013,7 +32013,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
catch (Exception /*e*/)
{ // should never happen
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "Exception parsing high surrogate '"
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "Exception parsing high surrogate '"
+ surrogatePair.Substring(1, 6 - 1) + "'");
}
if (char.IsHighSurrogate(highSurrogate))
@@ -32025,7 +32025,7 @@ namespace Lucene.Net.Analysis.CharFilters
}
catch (Exception /*e*/)
{ // should never happen
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "Exception parsing low surrogate '"
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "Exception parsing low surrogate '"
+ surrogatePair.Substring(9, 14 - 9) + "'");
}
if (char.IsLowSurrogate(lowSurrogate))
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/MappingCharFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/MappingCharFilter.cs
index a921887..dec5db1 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/MappingCharFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/MappingCharFilter.cs
@@ -136,7 +136,7 @@ namespace Lucene.Net.Analysis.CharFilters
if (!FST.TargetHasArcs(arc))
{
// Fast pass for single character match:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.IsFinal);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.IsFinal);
lastMatchLen = 1;
lastMatch = arc.Output;
}
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/NormalizeCharMap.cs b/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/NormalizeCharMap.cs
index 7186c94..e3963d2 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/NormalizeCharMap.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/NormalizeCharMap.cs
@@ -54,7 +54,7 @@ namespace Lucene.Net.Analysis.CharFilters
map.ReadFirstRealTargetArc(scratchArc.Target, scratchArc, fstReader);
while (true)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => scratchArc.Label != FST.END_LABEL);
+ if (Debugging.AssertsEnabled) Debugging.Assert(scratchArc.Label != FST.END_LABEL);
cachedRootArcs[Convert.ToChar((char)scratchArc.Label)] = (new FST.Arc<CharsRef>()).CopyFrom(scratchArc);
if (scratchArc.IsLast)
{
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/CompoundWordTokenFilterBase.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/CompoundWordTokenFilterBase.cs
index b60791e..bf5ecab 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/CompoundWordTokenFilterBase.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/CompoundWordTokenFilterBase.cs
@@ -110,7 +110,7 @@ namespace Lucene.Net.Analysis.Compound
{
if (m_tokens.Count > 0)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => current != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(current != null);
CompoundToken token = m_tokens.Dequeue();
RestoreState(current); // keep all other attributes untouched
m_termAtt.SetEmpty().Append(token.Text);
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Gl/GalicianStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Gl/GalicianStemmer.cs
index bf49cde..5d41c25 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Gl/GalicianStemmer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Gl/GalicianStemmer.cs
@@ -47,7 +47,7 @@ namespace Lucene.Net.Analysis.Gl
/// <returns> new valid length, stemmed </returns>
public virtual int Stem(char[] s, int len)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => s.Length >= len + 1, () => "this stemmer requires an oversized array of at least 1");
+ if (Debugging.AssertsEnabled) Debugging.Assert(s.Length >= len + 1, () => "this stemmer requires an oversized array of at least 1");
len = plural.Apply(s, len);
len = unification.Apply(s, len);
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs b/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs
index 305f0d1..0f4e984 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs
@@ -375,7 +375,7 @@ namespace Lucene.Net.Analysis.Hunspell
strip.CopyTo(0, stripData, currentOffset, strip.Length - 0);
currentOffset += strip.Length;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentIndex == seenStrips.Count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentIndex == seenStrips.Count);
stripOffsets[currentIndex] = currentOffset;
}
@@ -424,7 +424,7 @@ namespace Lucene.Net.Analysis.Hunspell
for (int i = 0; i < numLines; i++)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => affixWriter.Position == currentAffix << 3);
+ if (Debugging.AssertsEnabled) Debugging.Assert(affixWriter.Position == currentAffix << 3);
string line = reader.ReadLine();
string[] ruleArgs = whitespacePattern.Split(line).TrimEnd();
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Stemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Stemmer.cs
index 4ad0ee1..9388316 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Stemmer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Stemmer.cs
@@ -210,7 +210,7 @@ namespace Lucene.Net.Analysis.Hunspell
// cross check incoming continuation class (flag of previous affix) against list.
dictionary.flagLookup.Get(append, scratch);
char[] appendFlags = Dictionary.DecodeFlags(scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => prevFlag >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(prevFlag >= 0);
compatible = HasCrossCheckedFlag((char)prevFlag, appendFlags, false);
}
else
@@ -279,7 +279,7 @@ namespace Lucene.Net.Analysis.Hunspell
// cross check incoming continuation class (flag of previous affix) against list.
dictionary.flagLookup.Get(append, scratch);
char[] appendFlags = Dictionary.DecodeFlags(scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => prevFlag >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(prevFlag >= 0);
compatible = HasCrossCheckedFlag((char)prevFlag, appendFlags, previousWasPrefix);
}
else
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/ASCIIFoldingFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/ASCIIFoldingFilter.cs
index aa76247..f219184 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/ASCIIFoldingFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/ASCIIFoldingFilter.cs
@@ -92,7 +92,7 @@ namespace Lucene.Net.Analysis.Miscellaneous
{
if (state != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => preserveOriginal, () => "state should only be captured if preserveOriginal is true");
+ if (Debugging.AssertsEnabled) Debugging.Assert(preserveOriginal, () => "state should only be captured if preserveOriginal is true");
RestoreState(state);
posIncAttr.PositionIncrement = 0;
state = null;
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
index 225fae8..3e384bd 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
@@ -35,11 +35,11 @@ namespace Lucene.Net.Analysis.Miscellaneous
public SingleTokenTokenStream(Token token)
: base(Token.TOKEN_ATTRIBUTE_FACTORY)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => token != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(token != null);
this.singleToken = (Token)token.Clone();
tokenAtt = AddAttribute<ICharTermAttribute>();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => tokenAtt is Token);
+ if (Debugging.AssertsEnabled) Debugging.Assert(tokenAtt is Token);
}
public override sealed bool IncrementToken()
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/NGram/NGramTokenizer.cs b/src/Lucene.Net.Analysis.Common/Analysis/NGram/NGramTokenizer.cs
index 60bc879..d03c06d 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/NGram/NGramTokenizer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/NGram/NGramTokenizer.cs
@@ -232,7 +232,7 @@ namespace Lucene.Net.Analysis.NGram
{
if (bufferStart + 1 + minGram > bufferEnd)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => exhausted);
+ if (Debugging.AssertsEnabled) Debugging.Assert(exhausted);
return false;
}
Consume();
@@ -295,7 +295,7 @@ namespace Lucene.Net.Analysis.NGram
public override sealed void End()
{
base.End();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => bufferStart <= bufferEnd);
+ if (Debugging.AssertsEnabled) Debugging.Assert(bufferStart <= bufferEnd);
int endOffset = offset;
for (int i = bufferStart; i < bufferEnd; ++i)
{
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
index e901768..1b6f976 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
@@ -155,7 +155,7 @@ namespace Lucene.Net.Analysis.Pattern
{
if (currentMatcher != -1 && NextCapture())
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != null);
ClearAttributes();
RestoreState(state);
int start = matchers[currentMatcher].Groups[currentGroup[currentMatcher]].Index;
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Pt/PortugueseStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Pt/PortugueseStemmer.cs
index 8943de0..0d0a94c 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Pt/PortugueseStemmer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Pt/PortugueseStemmer.cs
@@ -46,7 +46,7 @@ namespace Lucene.Net.Analysis.Pt
/// <returns> new valid length, stemmed </returns>
public virtual int Stem(char[] s, int len)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => s.Length >= len + 1, () => "this stemmer requires an oversized array of at least 1");
+ if (Debugging.AssertsEnabled) Debugging.Assert(s.Length >= len + 1, () => "this stemmer requires an oversized array of at least 1");
len = plural.Apply(s, len);
len = adverb.Apply(s, len);
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Pt/RSLPStemmerBase.cs b/src/Lucene.Net.Analysis.Common/Analysis/Pt/RSLPStemmerBase.cs
index 594c88b..108a87a 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Pt/RSLPStemmerBase.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Pt/RSLPStemmerBase.cs
@@ -305,7 +305,7 @@ namespace Lucene.Net.Analysis.Pt
{
throw new Exception("Illegal Step header specified at line " /*+ r.LineNumber*/); // TODO Line number
}
- //if (Debugging.AssertsEnabled) Debugging.Assert(() => headerPattern.GetGroupNumbers().Length == 4); // Not possible to read the number of groups that matched in .NET
+ //if (Debugging.AssertsEnabled) Debugging.Assert(headerPattern.GetGroupNumbers().Length == 4); // Not possible to read the number of groups that matched in .NET
string name = matcher.Groups[1].Value;
int min = int.Parse(matcher.Groups[2].Value, CultureInfo.InvariantCulture);
int type = int.Parse(matcher.Groups[3].Value, CultureInfo.InvariantCulture);
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilter.cs
index a0c0786..e118268 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilter.cs
@@ -176,7 +176,7 @@ namespace Lucene.Net.Analysis.Synonym
public virtual CharsRef PullNext()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto < count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto < count);
lastEndOffset = endOffsets[upto];
lastPosLength = posLengths[upto];
CharsRef result = outputs[upto++];
@@ -306,7 +306,7 @@ namespace Lucene.Net.Analysis.Synonym
nextWrite = RollIncr(nextWrite);
// Buffer head should never catch up to tail:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextWrite != nextRead);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextWrite != nextRead);
}
/*
@@ -325,7 +325,7 @@ namespace Lucene.Net.Analysis.Synonym
{
//System.out.println("\nS: parse");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => inputSkipCount == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(inputSkipCount == 0);
int curNextRead = nextRead;
@@ -337,7 +337,7 @@ namespace Lucene.Net.Analysis.Synonym
BytesRef pendingOutput = fst.Outputs.NoOutput;
fst.GetFirstArc(scratchArc);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => scratchArc.Output == fst.Outputs.NoOutput);
+ if (Debugging.AssertsEnabled) Debugging.Assert(scratchArc.Output == fst.Outputs.NoOutput);
int tokenCount = 0;
@@ -364,7 +364,7 @@ namespace Lucene.Net.Analysis.Synonym
else
{
//System.out.println(" input.incrToken");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => futureInputs[nextWrite].consumed);
+ if (Debugging.AssertsEnabled) Debugging.Assert(futureInputs[nextWrite].consumed);
// Not correct: a syn match whose output is longer
// than its input can set future inputs keepOrig
// to true:
@@ -480,7 +480,7 @@ namespace Lucene.Net.Analysis.Synonym
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => finished);
+ if (Debugging.AssertsEnabled) Debugging.Assert(finished);
}
//System.out.println(" parse done inputSkipCount=" + inputSkipCount + " nextRead=" + nextRead + " nextWrite=" + nextWrite);
@@ -510,7 +510,7 @@ namespace Lucene.Net.Analysis.Synonym
int outputLen = chIDX - lastStart;
// Caller is not allowed to have empty string in
// the output:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => outputLen > 0, () => "output contains empty string: " + scratchChars);
+ if (Debugging.AssertsEnabled) Debugging.Assert(outputLen > 0, () => "output contains empty string: " + scratchChars);
int endOffset;
int posLen;
if (chIDX == chEnd && lastStart == scratchChars.Offset)
@@ -536,7 +536,7 @@ namespace Lucene.Net.Analysis.Synonym
lastStart = 1 + chIDX;
//System.out.println(" slot=" + outputUpto + " keepOrig=" + keepOrig);
outputUpto = RollIncr(outputUpto);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => futureOutputs[outputUpto].posIncr == 1, () => "outputUpto=" + outputUpto + " vs nextWrite=" + nextWrite);
+ if (Debugging.AssertsEnabled) Debugging.Assert(futureOutputs[outputUpto].posIncr == 1, () => "outputUpto=" + outputUpto + " vs nextWrite=" + nextWrite);
}
}
}
@@ -602,7 +602,7 @@ namespace Lucene.Net.Analysis.Synonym
{
// Pass-through case: return token we just pulled
// but didn't capture:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => inputSkipCount == 1, () => "inputSkipCount=" + inputSkipCount + " nextRead=" + nextRead);
+ if (Debugging.AssertsEnabled) Debugging.Assert(inputSkipCount == 1, () => "inputSkipCount=" + inputSkipCount + " nextRead=" + nextRead);
}
input.Reset();
if (outputs.count > 0)
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymMap.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymMap.cs
index 539233e..2e2e9b5 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymMap.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymMap.cs
@@ -175,8 +175,8 @@ namespace Lucene.Net.Analysis.Synonym
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => !HasHoles(input), () => "input has holes: " + input);
- Debugging.Assert(() => !HasHoles(output), () => "output has holes: " + output);
+ Debugging.Assert(!HasHoles(input), () => "input has holes: " + input);
+ Debugging.Assert(!HasHoles(output), () => "output has holes: " + output);
}
//System.out.println("fmap.add input=" + input + " numInputWords=" + numInputWords + " output=" + output + " numOutputWords=" + numOutputWords);
@@ -284,7 +284,7 @@ namespace Lucene.Net.Analysis.Synonym
scratch.Grow(estimatedSize);
scratchOutput.Reset(scratch.Bytes, scratch.Offset, scratch.Bytes.Length);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => scratch.Offset == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(scratch.Offset == 0);
// now write our output data:
int count = 0;
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs
index a4be3e6..b2dd01a 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs
@@ -632,7 +632,7 @@ namespace Lucene.Net.Analysis.Util
private void Rehash()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => keys.Length == values.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(keys.Length == values.Length);
int newSize = 2 * keys.Length;
char[][] oldkeys = keys;
MapValue[] oldvalues = values;
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharTokenizer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharTokenizer.cs
index 9eda606..bfb15ba 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharTokenizer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharTokenizer.cs
@@ -169,7 +169,7 @@ namespace Lucene.Net.Analysis.Util
{
if (length == 0) // start of token
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => start == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(start == -1);
start = offset + bufferIndex - charCount;
end = start;
} // check if a supplementary could run out of bounds
@@ -191,7 +191,7 @@ namespace Lucene.Net.Analysis.Util
}
termAtt.Length = length;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => start != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(start != -1);
offsetAtt.SetOffset(CorrectOffset(start), finalOffset = CorrectOffset(end));
return true;
}
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs
index 3822951..1982064 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs
@@ -178,8 +178,8 @@ namespace Lucene.Net.Analysis.Util
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => buffer.Length >= length);
- Debugging.Assert(() => offset <= 0 && offset <= buffer.Length);
+ Debugging.Assert(buffer.Length >= length);
+ Debugging.Assert(offset <= 0 && offset <= buffer.Length);
}
// Slight optimization, eliminating a few method calls internally
@@ -212,8 +212,8 @@ namespace Lucene.Net.Analysis.Util
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => buffer.Length >= length);
- Debugging.Assert(() => offset <= 0 && offset <= buffer.Length);
+ Debugging.Assert(buffer.Length >= length);
+ Debugging.Assert(offset <= 0 && offset <= buffer.Length);
}
// Slight optimization, eliminating a few method calls internally
@@ -355,7 +355,7 @@ namespace Lucene.Net.Analysis.Util
public override bool Fill(CharacterBuffer buffer, TextReader reader, int numChars)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => buffer.Buffer.Length >= 2);
+ if (Debugging.AssertsEnabled) Debugging.Assert(buffer.Buffer.Length >= 2);
if (numChars < 2 || numChars > buffer.Buffer.Length)
{
throw new ArgumentException("numChars must be >= 2 and <= the buffer size");
@@ -476,7 +476,7 @@ namespace Lucene.Net.Analysis.Util
public override bool Fill(CharacterBuffer buffer, TextReader reader, int numChars)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => buffer.Buffer.Length >= 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(buffer.Buffer.Length >= 1);
if (numChars < 1 || numChars > buffer.Buffer.Length)
{
throw new ArgumentException("numChars must be >= 1 and <= the buffer size");
@@ -541,8 +541,8 @@ namespace Lucene.Net.Analysis.Util
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => buffer.Length >= limit);
- Debugging.Assert(() => offset <= 0 && offset <= buffer.Length);
+ Debugging.Assert(buffer.Length >= limit);
+ Debugging.Assert(offset <= 0 && offset <= buffer.Length);
}
for (int i = offset; i < limit;)
@@ -557,8 +557,8 @@ namespace Lucene.Net.Analysis.Util
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => buffer.Length >= limit);
- Debugging.Assert(() => offset <= 0 && offset <= buffer.Length);
+ Debugging.Assert(buffer.Length >= limit);
+ Debugging.Assert(offset <= 0 && offset <= buffer.Length);
}
for (int i = offset; i < limit;)
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/RollingCharBuffer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/RollingCharBuffer.cs
index 49d2d81..a840759 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/RollingCharBuffer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/RollingCharBuffer.cs
@@ -108,10 +108,10 @@ namespace Lucene.Net.Analysis.Util
else
{
// Cannot read from future (except by 1):
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pos < nextPos);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pos < nextPos);
// Cannot read from already freed past:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextPos - pos <= count, () => "nextPos=" + nextPos + " pos=" + pos + " count=" + count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextPos - pos <= count, () => "nextPos=" + nextPos + " pos=" + pos + " count=" + count);
return buffer[GetIndex(pos)];
}
@@ -130,7 +130,7 @@ namespace Lucene.Net.Analysis.Util
{
// Wrap:
index += buffer.Length;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => index >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(index >= 0);
}
return index;
}
@@ -139,8 +139,8 @@ namespace Lucene.Net.Analysis.Util
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => length > 0);
- Debugging.Assert(() => InBounds(posStart), () => "posStart=" + posStart + " length=" + length);
+ Debugging.Assert(length > 0);
+ Debugging.Assert(InBounds(posStart), () => "posStart=" + posStart + " length=" + length);
}
//System.out.println(" buffer.Get posStart=" + posStart + " len=" + length);
@@ -171,14 +171,14 @@ namespace Lucene.Net.Analysis.Util
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => pos >= 0);
- Debugging.Assert(() => pos <= nextPos);
+ Debugging.Assert(pos >= 0);
+ Debugging.Assert(pos <= nextPos);
}
int newCount = nextPos - pos;
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => newCount <= count, () => "newCount=" + newCount + " count=" + count);
- Debugging.Assert(() => newCount <= buffer.Length, () => "newCount=" + newCount + " buf.length=" + buffer.Length);
+ Debugging.Assert(newCount <= count, () => "newCount=" + newCount + " count=" + count);
+ Debugging.Assert(newCount <= buffer.Length, () => "newCount=" + newCount + " buf.length=" + buffer.Length);
}
count = newCount;
}
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs
index 39c6594..34ef795 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs
@@ -184,7 +184,7 @@ namespace Lucene.Net.Analysis.Util
/// commons-io's readFully, but without bugs if offset != 0 </summary>
private static int Read(TextReader input, char[] buffer, int offset, int length)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => length >= 0, () => "length must not be negative: " + length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(length >= 0, () => "length must not be negative: " + length);
int remaining = length;
while (remaining > 0)
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/StemmerUtil.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/StemmerUtil.cs
index d4eb3e7..a6f0ebc 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/StemmerUtil.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/StemmerUtil.cs
@@ -117,7 +117,7 @@ namespace Lucene.Net.Analysis.Util
/// <returns> length of input buffer after deletion </returns>
public static int Delete(char[] s, int pos, int len)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pos < len);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pos < len);
if (pos < len - 1) // don't arraycopy if asked to delete last character
{
Array.Copy(s, pos + 1, s, pos, len - pos - 1);
@@ -135,7 +135,7 @@ namespace Lucene.Net.Analysis.Util
/// <returns> length of input buffer after deletion </returns>
public static int DeleteN(char[] s, int pos, int len, int nChars)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pos + nChars <= len);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pos + nChars <= len);
if (pos + nChars < len) // don't arraycopy if asked to delete the last characters
{
Array.Copy(s, pos + nChars, s, pos, len - pos - nChars);
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2CharFilter.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2CharFilter.cs
index fcd4bb0..49ff4a3 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2CharFilter.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2CharFilter.cs
@@ -128,7 +128,7 @@ namespace Lucene.Net.Analysis.Icu
bool hasRemainingChars = CharacterUtils.GetInstance(LuceneVersion.LUCENE_CURRENT).Fill(tmpBuffer, m_input);
#pragma warning restore 612, 618
- if (Debugging.AssertsEnabled) Debugging.Assert(() => tmpBuffer.Offset == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(tmpBuffer.Offset == 0);
inputBuffer.Append(tmpBuffer.Buffer, 0, tmpBuffer.Length);
if (hasRemainingChars == false)
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizer.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizer.cs
index 9eb4d51..1afbfc1 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizer.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizer.cs
@@ -194,7 +194,7 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
/// <summary>commons-io's readFully, but without bugs if offset != 0</summary>
private static int Read(TextReader input, char[] buffer, int offset, int length)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => length >= 0, () => "length must not be negative: " + length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(length >= 0, () => "length must not be negative: " + length);
int remaining = length;
while (remaining > 0)
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerFactory.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerFactory.cs
index 8629acd..823e8a6 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerFactory.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerFactory.cs
@@ -102,7 +102,7 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
public virtual void Inform(IResourceLoader loader)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => tailored != null, () => "init must be called first!");
+ if (Debugging.AssertsEnabled) Debugging.Assert(tailored != null, () => "init must be called first!");
if (tailored.Count == 0)
{
config = new DefaultICUTokenizerConfig(cjkAsWords, myanmarAsWords);
@@ -162,7 +162,7 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
public override Tokenizer Create(AttributeSource.AttributeFactory factory, TextReader input)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => config != null, () => "inform must be called first!");
+ if (Debugging.AssertsEnabled) Debugging.Assert(config != null, () => "inform must be called first!");
return new ICUTokenizer(factory, input, config);
}
}
diff --git a/src/Lucene.Net.Analysis.Kuromoji/Dict/TokenInfoFST.cs b/src/Lucene.Net.Analysis.Kuromoji/Dict/TokenInfoFST.cs
index 354c377..bab5b66 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/Dict/TokenInfoFST.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/Dict/TokenInfoFST.cs
@@ -75,7 +75,7 @@ namespace Lucene.Net.Analysis.Ja.Dict
{
if (useCache && ch >= 0x3040 && ch <= cacheCeiling)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ch != FST.END_LABEL);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ch != FST.END_LABEL);
FST.Arc<long?> result = rootCache[ch - 0x3040];
if (result == null)
{
diff --git a/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs b/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs
index 617f748..0570a17 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs
@@ -91,8 +91,8 @@ namespace Lucene.Net.Analysis.Ja
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => !bestPathMap.ContainsKey(fromNodeID));
- Debugging.Assert(() => !bestPathMap.Values.Contains(toNodeID));
+ Debugging.Assert(!bestPathMap.ContainsKey(fromNodeID));
+ Debugging.Assert(!bestPathMap.Values.Contains(toNodeID));
}
bestPathMap[fromNodeID] = toNodeID;
pos = backPos;
diff --git a/src/Lucene.Net.Analysis.Kuromoji/JapaneseIterationMarkCharFilter.cs b/src/Lucene.Net.Analysis.Kuromoji/JapaneseIterationMarkCharFilter.cs
index fb899c7..ac781db 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/JapaneseIterationMarkCharFilter.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/JapaneseIterationMarkCharFilter.cs
@@ -133,7 +133,7 @@ namespace Lucene.Net.Analysis.Ja
// Make katakana dakuten map from hiragana map
char codePointDifference = (char)('\u30ab' - '\u304b'); // カ - か
- if (Debugging.AssertsEnabled) Debugging.Assert(() => h2d.Length == k2d.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(h2d.Length == k2d.Length);
for (int i = 0; i < k2d.Length; i++)
{
k2d[i] = (char)(h2d[i] + codePointDifference);
diff --git a/src/Lucene.Net.Analysis.Kuromoji/JapaneseTokenizer.cs b/src/Lucene.Net.Analysis.Kuromoji/JapaneseTokenizer.cs
index 8210652..01295b5 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/JapaneseTokenizer.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/JapaneseTokenizer.cs
@@ -314,7 +314,7 @@ namespace Lucene.Net.Analysis.Ja
int leftID = dict.GetLeftId(wordID);
int leastCost = int.MaxValue;
int leastIDX = -1;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fromPosData.count > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fromPosData.count > 0);
for (int idx = 0; idx < fromPosData.count; idx++)
{
// Cost is path cost so far, plus word cost (added at
@@ -356,7 +356,7 @@ namespace Lucene.Net.Analysis.Ja
}
//positions.get(endPos).add(leastCost, dict.getRightId(wordID), fromPosData.pos, leastIDX, wordID, type);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => leftID == dict.GetRightId(wordID));
+ if (Debugging.AssertsEnabled) Debugging.Assert(leftID == dict.GetRightId(wordID));
positions.Get(endPos).Add(leastCost, leftID, fromPosData.pos, leastIDX, wordID, type);
}
@@ -387,7 +387,7 @@ namespace Lucene.Net.Analysis.Ja
int position = token.Position;
int length = token.Length;
ClearAttributes();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => length > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(length > 0);
//System.out.println("off=" + token.getOffset() + " len=" + length + " vs " + token.getSurfaceForm().length);
termAtt.CopyBuffer(token.SurfaceForm, token.Offset, length);
offsetAtt.SetOffset(CorrectOffset(position), CorrectOffset(position + length));
@@ -402,7 +402,7 @@ namespace Lucene.Net.Analysis.Ja
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => token.Position > lastTokenPos);
+ if (Debugging.AssertsEnabled) Debugging.Assert(token.Position > lastTokenPos);
posIncAtt.PositionIncrement = 1;
posLengthAtt.PositionLength = 1;
}
@@ -511,7 +511,7 @@ namespace Lucene.Net.Analysis.Ja
}
// We will always have at least one live path:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => leastIDX != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(leastIDX != -1);
// Second pass: prune all but the best path:
for (int pos2 = pos; pos2 < positions.GetNextPos(); pos2++)
@@ -544,7 +544,7 @@ namespace Lucene.Net.Analysis.Ja
if (pos != leastPosData.pos)
{
// We jumped into a future position:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pos < leastPosData.pos);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pos < leastPosData.pos);
pos = leastPosData.pos;
}
@@ -913,10 +913,10 @@ namespace Lucene.Net.Analysis.Ja
{
//System.out.println("BT: back pos=" + pos + " bestIDX=" + bestIDX);
Position posData = positions.Get(pos);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => bestIDX < posData.count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(bestIDX < posData.count);
int backPos = posData.backPos[bestIDX];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => backPos >= lastBackTracePos, () => "backPos=" + backPos + " vs lastBackTracePos=" + lastBackTracePos);
+ if (Debugging.AssertsEnabled) Debugging.Assert(backPos >= lastBackTracePos, () => "backPos=" + backPos + " vs lastBackTracePos=" + lastBackTracePos);
int length = pos - backPos;
JapaneseTokenizerType backType = posData.backType[bestIDX];
int backID = posData.backID[bestIDX];
@@ -989,7 +989,7 @@ namespace Lucene.Net.Analysis.Ja
if (leastIDX != -1 && leastCost <= maxCost && posData.backPos[leastIDX] != backPos)
{
// We should have pruned the altToken from the graph:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => posData.backPos[leastIDX] != backPos);
+ if (Debugging.AssertsEnabled) Debugging.Assert(posData.backPos[leastIDX] != backPos);
// Save the current compound token, to output when
// this alternate path joins back:
@@ -1024,7 +1024,7 @@ namespace Lucene.Net.Analysis.Ja
}
int offset = backPos - lastBackTracePos;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => offset >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(offset >= 0);
if (altToken != null && altToken.Position >= backPos)
{
@@ -1035,7 +1035,7 @@ namespace Lucene.Net.Analysis.Ja
// The pruning we did when we created the altToken
// ensures that the back trace will align back with
// the start of the altToken:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => altToken.Position == backPos, () => altToken.Position + " vs " + backPos);
+ if (Debugging.AssertsEnabled) Debugging.Assert(altToken.Position == backPos, () => altToken.Position + " vs " + backPos);
// NOTE: not quite right: the compound token may
// have had all punctuation back traced so far, but
@@ -1060,7 +1060,7 @@ namespace Lucene.Net.Analysis.Ja
{
Console.WriteLine(" discard all-punctuation altToken=" + altToken);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => discardPunctuation);
+ if (Debugging.AssertsEnabled) Debugging.Assert(discardPunctuation);
}
altToken = null;
}
@@ -1355,7 +1355,7 @@ namespace Lucene.Net.Analysis.Ja
{
count = 0;
// forwardCount naturally resets after it runs:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => forwardCount == 0, () => "pos=" + pos + " forwardCount=" + forwardCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(forwardCount == 0, () => "pos=" + pos + " forwardCount=" + forwardCount);
}
}
@@ -1432,13 +1432,13 @@ namespace Lucene.Net.Analysis.Ja
nextWrite = 0;
}
// Should have already been reset:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => positions[nextWrite].count == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(positions[nextWrite].count == 0);
positions[nextWrite++].pos = nextPos++;
count++;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => InBounds(pos));
+ if (Debugging.AssertsEnabled) Debugging.Assert(InBounds(pos));
int index = GetIndex(pos);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => positions[index].pos == pos);
+ if (Debugging.AssertsEnabled) Debugging.Assert(positions[index].pos == pos);
return positions[index];
}
@@ -1468,8 +1468,8 @@ namespace Lucene.Net.Analysis.Ja
int toFree = count - (nextPos - pos);
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => toFree >= 0);
- Debugging.Assert(() => toFree <= count);
+ Debugging.Assert(toFree >= 0);
+ Debugging.Assert(toFree <= count);
}
int index = nextWrite - count;
if (index < 0)
diff --git a/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs b/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs
index 7df6295..ef9a11c 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs
@@ -61,7 +61,7 @@ namespace Lucene.Net.Analysis.Ja.Util
for (int i = 4; i < 8; i++)
{
string part = entry[i];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => part.Length > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(part.Length > 0);
if (!"*".Equals(part, StringComparison.Ordinal))
{
if (sb.Length > 0)
@@ -120,8 +120,8 @@ namespace Lucene.Net.Analysis.Ja.Util
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => leftId == rightId);
- Debugging.Assert(() => leftId < 4096); // there are still unused bits
+ Debugging.Assert(leftId == rightId);
+ Debugging.Assert(leftId < 4096); // there are still unused bits
}
// add pos mapping
int toFill = 1 + leftId - posDict.Count;
@@ -131,7 +131,7 @@ namespace Lucene.Net.Analysis.Ja.Util
}
string existing = posDict[leftId];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => existing == null || existing.Equals(fullPOSData, StringComparison.Ordinal));
+ if (Debugging.AssertsEnabled) Debugging.Assert(existing == null || existing.Equals(fullPOSData, StringComparison.Ordinal));
posDict[leftId] = fullPOSData;
m_buffer.PutInt16((short)(leftId << 3 | flags));
@@ -139,7 +139,7 @@ namespace Lucene.Net.Analysis.Ja.Util
if ((flags & BinaryDictionary.HAS_BASEFORM) != 0)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => baseForm.Length < 16);
+ if (Debugging.AssertsEnabled) Debugging.Assert(baseForm.Length < 16);
int shared = SharedPrefix(entry[0], baseForm);
int suffix = baseForm.Length - shared;
m_buffer.Put((byte)(shared << 4 | suffix));
@@ -240,11 +240,11 @@ namespace Lucene.Net.Analysis.Ja.Util
public virtual void AddMapping(int sourceId, int wordId)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => wordId > lastWordId, () => "words out of order: " + wordId + " vs lastID: " + lastWordId);
+ if (Debugging.AssertsEnabled) Debugging.Assert(wordId > lastWordId, () => "words out of order: " + wordId + " vs lastID: " + lastWordId);
if (sourceId > lastSourceId)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sourceId > lastSourceId, () => "source ids out of order: lastSourceId=" + lastSourceId + " vs sourceId=" + sourceId);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sourceId > lastSourceId, () => "source ids out of order: lastSourceId=" + lastSourceId + " vs sourceId=" + sourceId);
targetMapOffsets = ArrayUtil.Grow(targetMapOffsets, sourceId + 1);
for (int i = lastSourceId + 1; i <= sourceId; i++)
{
@@ -253,7 +253,7 @@ namespace Lucene.Net.Analysis.Ja.Util
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sourceId == lastSourceId);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sourceId == lastSourceId);
}
targetMap = ArrayUtil.Grow(targetMap, targetMapEndOffset + 1);
@@ -308,7 +308,7 @@ namespace Lucene.Net.Analysis.Ja.Util
for (int ofs = 0; ofs < targetMapEndOffset; ofs++)
{
int val = targetMap[ofs], delta = val - prev;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => delta >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(delta >= 0);
if (ofs == targetMapOffsets[sourceId])
{
@out.WriteVInt32((delta << 1) | 0x01);
@@ -320,7 +320,7 @@ namespace Lucene.Net.Analysis.Ja.Util
}
prev += delta;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sourceId == numSourceIds, () => "sourceId:" + sourceId + " != numSourceIds:" + numSourceIds);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sourceId == numSourceIds, () => "sourceId:" + sourceId + " != numSourceIds:" + numSourceIds);
}
}
@@ -344,7 +344,7 @@ namespace Lucene.Net.Analysis.Ja.Util
else
{
string[] data = CSVUtil.Parse(s);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => data.Length == 3, () => "malformed pos/inflection: " + s);
+ if (Debugging.AssertsEnabled) Debugging.Assert(data.Length == 3, () => "malformed pos/inflection: " + s);
@out.WriteString(data[0]);
@out.WriteString(data[1]);
@out.WriteString(data[2]);
@@ -373,7 +373,7 @@ namespace Lucene.Net.Analysis.Ja.Util
@out.WriteByte(m_buffer.Get());
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_buffer.Remaining == 0L);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_buffer.Remaining == 0L);
}
}
}
diff --git a/src/Lucene.Net.Analysis.Kuromoji/Tools/ConnectionCostsBuilder.cs b/src/Lucene.Net.Analysis.Kuromoji/Tools/ConnectionCostsBuilder.cs
index 3e66621..1d7d8e3 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/Tools/ConnectionCostsBuilder.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/Tools/ConnectionCostsBuilder.cs
@@ -41,12 +41,12 @@ namespace Lucene.Net.Analysis.Ja.Util
string line = streamReader.ReadLine();
string[] dimensions = whiteSpaceRegex.Split(line).TrimEnd();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => dimensions.Length == 2);
+ if (Debugging.AssertsEnabled) Debugging.Assert(dimensions.Length == 2);
int forwardSize = int.Parse(dimensions[0], CultureInfo.InvariantCulture);
int backwardSize = int.Parse(dimensions[1], CultureInfo.InvariantCulture);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => forwardSize > 0 && backwardSize > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(forwardSize > 0 && backwardSize > 0);
ConnectionCostsWriter costs = new ConnectionCostsWriter(forwardSize, backwardSize);
@@ -54,7 +54,7 @@ namespace Lucene.Net.Analysis.Ja.Util
{
string[] fields = whiteSpaceRegex.Split(line).TrimEnd();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fields.Length == 3);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fields.Length == 3);
int forwardId = int.Parse(fields[0], CultureInfo.InvariantCulture);
int backwardId = int.Parse(fields[1], CultureInfo.InvariantCulture);
diff --git a/src/Lucene.Net.Analysis.Kuromoji/Tools/ConnectionCostsWriter.cs b/src/Lucene.Net.Analysis.Kuromoji/Tools/ConnectionCostsWriter.cs
index e49253e..4b5fdb4 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/Tools/ConnectionCostsWriter.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/Tools/ConnectionCostsWriter.cs
@@ -63,10 +63,10 @@ namespace Lucene.Net.Analysis.Ja.Util
@out.WriteVInt32(forwardSize);
@out.WriteVInt32(backwardSize);
int last = 0;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => costs.Length == backwardSize);
+ if (Debugging.AssertsEnabled) Debugging.Assert(costs.Length == backwardSize);
foreach (short[] a in costs)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => a.Length == forwardSize);
+ if (Debugging.AssertsEnabled) Debugging.Assert(a.Length == forwardSize);
for (int i = 0; i < a.Length; i++)
{
int delta = (int)a[i] - last;
diff --git a/src/Lucene.Net.Analysis.Phonetic/BeiderMorseFilter.cs b/src/Lucene.Net.Analysis.Phonetic/BeiderMorseFilter.cs
index 641a400..0191323 100644
--- a/src/Lucene.Net.Analysis.Phonetic/BeiderMorseFilter.cs
+++ b/src/Lucene.Net.Analysis.Phonetic/BeiderMorseFilter.cs
@@ -85,7 +85,7 @@ namespace Lucene.Net.Analysis.Phonetic
if (matcher.Success)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != null && encoded != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != null && encoded != null);
RestoreState(state);
int start = matcher.Index;
diff --git a/src/Lucene.Net.Benchmark/ByTask/Utils/AnalyzerFactory.cs b/src/Lucene.Net.Benchmark/ByTask/Utils/AnalyzerFactory.cs
index d7ea253..257c662 100644
--- a/src/Lucene.Net.Benchmark/ByTask/Utils/AnalyzerFactory.cs
+++ b/src/Lucene.Net.Benchmark/ByTask/Utils/AnalyzerFactory.cs
@@ -42,7 +42,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Utils
IList<TokenFilterFactory> tokenFilterFactories)
{
this.charFilterFactories = charFilterFactories;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => null != tokenizerFactory);
+ if (Debugging.AssertsEnabled) Debugging.Assert(null != tokenizerFactory);
this.tokenizerFactory = tokenizerFactory;
this.tokenFilterFactories = tokenFilterFactories;
}
diff --git a/src/Lucene.Net.Benchmark/Quality/QualityStats.cs b/src/Lucene.Net.Benchmark/Quality/QualityStats.cs
index 633599f..a83a695 100644
--- a/src/Lucene.Net.Benchmark/Quality/QualityStats.cs
+++ b/src/Lucene.Net.Benchmark/Quality/QualityStats.cs
@@ -242,7 +242,7 @@ namespace Lucene.Net.Benchmarks.Quality
}
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m > 0, () => "Fishy: no \"good\" queries!");
+ if (Debugging.AssertsEnabled) Debugging.Assert(m > 0, () => "Fishy: no \"good\" queries!");
// take average: times go by all queries, other measures go by "good" queries only.
avg.searchTime /= stats.Length;
avg.docNamesExtractTime /= stats.Length;
diff --git a/src/Lucene.Net.Benchmark/Quality/Trec/TrecJudge.cs b/src/Lucene.Net.Benchmark/Quality/Trec/TrecJudge.cs
index 4f51d9a..a973cf0 100644
--- a/src/Lucene.Net.Benchmark/Quality/Trec/TrecJudge.cs
+++ b/src/Lucene.Net.Benchmark/Quality/Trec/TrecJudge.cs
@@ -73,7 +73,7 @@ namespace Lucene.Net.Benchmarks.Quality.Trec
st.MoveNext();
bool relevant = !zero.Equals(st.Current, StringComparison.Ordinal);
// LUCENENET: don't call st.NextToken() unless the condition fails.
- if (Debugging.AssertsEnabled) Debugging.Assert(() => st.RemainingTokens == 0, () => "wrong format: " + line + " next: " + (st.MoveNext() ? st.Current : ""));
+ if (Debugging.AssertsEnabled) Debugging.Assert(st.RemainingTokens == 0, () => "wrong format: " + line + " next: " + (st.MoveNext() ? st.Current : ""));
if (relevant)
{ // only keep relevant docs
if (curr == null || !curr.queryID.Equals(queryID, StringComparison.Ordinal))
diff --git a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs
index d9c8ccf..f5e1f6c 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs
@@ -127,7 +127,7 @@ namespace Lucene.Net.Codecs.BlockTerms
{
int field = input.ReadVInt32();
long numTerms = input.ReadVInt64();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numTerms >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numTerms >= 0);
long termsStartPointer = input.ReadVInt64();
FieldInfo fieldInfo = fieldInfos.FieldInfo(field);
long sumTotalTermFreq = fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY ? -1 : input.ReadVInt64();
@@ -234,7 +234,7 @@ namespace Lucene.Net.Codecs.BlockTerms
public override Terms GetTerms(string field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field != null);
FieldReader result;
fields.TryGetValue(field, out result);
@@ -258,7 +258,7 @@ namespace Lucene.Net.Codecs.BlockTerms
public FieldReader(BlockTermsReader outerInstance, FieldInfo fieldInfo, long numTerms, long termsStartPointer, long sumTotalTermFreq,
long sumDocFreq, int docCount, int longsSize)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numTerms > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numTerms > 0);
this.outerInstance = outerInstance;
@@ -449,7 +449,7 @@ namespace Lucene.Net.Codecs.BlockTerms
// Block must exist since, at least, the indexed term
// is in the block:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => result);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result);
indexIsCurrent = true;
didIndexNext = false;
@@ -537,7 +537,7 @@ namespace Lucene.Net.Codecs.BlockTerms
// Target's prefix is before the common prefix
// of this block, so we position to start of
// block and return NOT_FOUND:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state.TermBlockOrd == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state.TermBlockOrd == 0);
int suffix = termSuffixesReader.ReadVInt32();
term.Length = termBlockPrefix + suffix;
@@ -642,7 +642,7 @@ namespace Lucene.Net.Codecs.BlockTerms
// cross another index term (besides the first
// one) while we are scanning:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexIsCurrent);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexIsCurrent);
if (!NextBlock())
{
@@ -665,7 +665,7 @@ namespace Lucene.Net.Codecs.BlockTerms
// works properly:
if (seekPending)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !indexIsCurrent);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!indexIsCurrent);
input.Seek(state.BlockFilePointer);
int pendingSeekCount = state.TermBlockOrd;
bool result = NextBlock();
@@ -675,12 +675,12 @@ namespace Lucene.Net.Codecs.BlockTerms
// Block must exist since seek(TermState) was called w/ a
// TermState previously returned by this enum when positioned
// on a real term:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => result);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result);
while (state.TermBlockOrd < pendingSeekCount)
{
BytesRef nextResult = _next();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextResult != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextResult != null);
}
seekPending = false;
state.Ord = savOrd;
@@ -771,8 +771,8 @@ namespace Lucene.Net.Codecs.BlockTerms
//System.out.println("BTR.seekExact termState target=" + target.utf8ToString() + " " + target + " this=" + this);
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => otherState != null && otherState is BlockTermState);
- Debugging.Assert(() => !doOrd || ((BlockTermState)otherState).Ord < outerInstance.numTerms);
+ Debugging.Assert(otherState != null && otherState is BlockTermState);
+ Debugging.Assert(!doOrd || ((BlockTermState)otherState).Ord < outerInstance.numTerms);
}
state.CopyFrom(otherState);
seekPending = true;
@@ -797,7 +797,7 @@ namespace Lucene.Net.Codecs.BlockTerms
throw new InvalidOperationException("terms index was not loaded");
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord < outerInstance.numTerms);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord < outerInstance.numTerms);
// TODO: if ord is in same terms block and
// after current ord, we should avoid this seek just
@@ -806,7 +806,7 @@ namespace Lucene.Net.Codecs.BlockTerms
bool result = NextBlock();
// Block must exist since ord < numTerms:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => result);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result);
indexIsCurrent = true;
didIndexNext = false;
@@ -814,7 +814,7 @@ namespace Lucene.Net.Codecs.BlockTerms
seekPending = false;
state.Ord = indexEnum.Ord - 1;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state.Ord >= -1, () => "Ord=" + state.Ord);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state.Ord >= -1, () => "Ord=" + state.Ord);
term.CopyBytes(indexEnum.Term);
// Now, scan:
@@ -822,9 +822,9 @@ namespace Lucene.Net.Codecs.BlockTerms
while (left > 0)
{
BytesRef term = _next();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => term != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(term != null);
left--;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexIsCurrent);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexIsCurrent);
}
}
diff --git a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
index 18eb752..87ecb55 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
@@ -70,7 +70,7 @@ namespace Lucene.Net.Codecs.BlockTerms
public FieldMetaData(FieldInfo fieldInfo, long numTerms, long termsStartPointer, long sumTotalTermFreq,
long sumDocFreq, int docCount, int int64sSize)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numTerms > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numTerms > 0);
FieldInfo = fieldInfo;
TermsStartPointer = termsStartPointer;
@@ -123,7 +123,7 @@ namespace Lucene.Net.Codecs.BlockTerms
public override TermsConsumer AddField(FieldInfo field)
{
//System.out.println("\nBTW.addField seg=" + segment + " field=" + field.name);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentField == null || currentField.Name.CompareToOrdinal(field.Name) < 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentField == null || currentField.Name.CompareToOrdinal(field.Name) < 0);
currentField = field;
TermsIndexWriterBase.FieldWriter fieldIndexWriter = termsIndexWriter.AddField(field, m_output.GetFilePointer());
return new TermsWriter(this, fieldIndexWriter, field, postingsWriter);
@@ -235,7 +235,7 @@ namespace Lucene.Net.Codecs.BlockTerms
public override void FinishTerm(BytesRef text, TermStats stats)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stats.DocFreq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stats.DocFreq > 0);
//System.out.println("BTW: finishTerm term=" + fieldInfo.name + ":" + text.utf8ToString() + " " + text + " seg=" + segment + " df=" + stats.docFreq);
bool isIndexTerm = fieldIndexWriter.CheckIndexTerm(text, stats);
@@ -304,8 +304,8 @@ namespace Lucene.Net.Codecs.BlockTerms
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => term1.Offset == 0);
- Debugging.Assert(() => term2.Offset == 0);
+ Debugging.Assert(term1.Offset == 0);
+ Debugging.Assert(term2.Offset == 0);
}
int pos1 = 0;
int pos1End = pos1 + Math.Min(term1.Length, term2.Length);
@@ -362,7 +362,7 @@ namespace Lucene.Net.Codecs.BlockTerms
for (int termCount = 0; termCount < pendingCount; termCount++)
{
BlockTermState state = pendingTerms[termCount].State;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != null);
bytesWriter.WriteVInt32(state.DocFreq);
if (fieldInfo.IndexOptions != IndexOptions.DOCS_ONLY)
{
diff --git a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
index ca21abb..2d62b7b 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
@@ -70,7 +70,7 @@ namespace Lucene.Net.Codecs.BlockTerms
{
this.termComp = termComp;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexDivisor == -1 || indexDivisor > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexDivisor == -1 || indexDivisor > 0);
input = dir.OpenInput(IndexFileNames.SegmentFileName(segment, segmentSuffix, FixedGapTermsIndexWriter.TERMS_INDEX_EXTENSION), context);
@@ -101,7 +101,7 @@ namespace Lucene.Net.Codecs.BlockTerms
// In case terms index gets loaded, later, on demand
totalIndexInterval = indexInterval * indexDivisor;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => totalIndexInterval > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(totalIndexInterval > 0);
SeekDir(input, dirOffset);
@@ -190,7 +190,7 @@ namespace Lucene.Net.Codecs.BlockTerms
{
int lo = 0; // binary search
int hi = fieldIndex.numIndexTerms - 1;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => outerInstance.totalIndexInterval > 0, () => "totalIndexInterval=" + outerInstance.totalIndexInterval);
+ if (Debugging.AssertsEnabled) Debugging.Assert(outerInstance.totalIndexInterval > 0, () => "totalIndexInterval=" + outerInstance.totalIndexInterval);
while (hi >= lo)
{
@@ -211,7 +211,7 @@ namespace Lucene.Net.Codecs.BlockTerms
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => mid >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(mid >= 0);
ord = mid * outerInstance.totalIndexInterval;
return fieldIndex.termsStart + fieldIndex.termsDictOffsets.Get(mid);
}
@@ -219,7 +219,7 @@ namespace Lucene.Net.Codecs.BlockTerms
if (hi < 0)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => hi == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(hi == -1);
hi = 0;
}
@@ -252,7 +252,7 @@ namespace Lucene.Net.Codecs.BlockTerms
{
int idx = (int)(ord / outerInstance.totalIndexInterval);
// caller must ensure ord is in bounds
- if (Debugging.AssertsEnabled) Debugging.Assert(() => idx < fieldIndex.numIndexTerms);
+ if (Debugging.AssertsEnabled) Debugging.Assert(idx < fieldIndex.numIndexTerms);
long offset = fieldIndex.termOffsets.Get(idx);
int length = (int)(fieldIndex.termOffsets.Get(1 + idx) - offset);
outerInstance.termBytesReader.FillSlice(term, fieldIndex.termBytesStart + offset, length);
@@ -328,11 +328,11 @@ namespace Lucene.Net.Codecs.BlockTerms
// -1 is passed to mean "don't load term index", but
// if we are then later loaded it's overwritten with
// a real value
- if (Debugging.AssertsEnabled) Debugging.Assert(() => outerInstance.outerInstance.indexDivisor > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(outerInstance.outerInstance.indexDivisor > 0);
this.numIndexTerms = 1 + (numIndexTerms - 1) / outerInstance.outerInstance.indexDivisor;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => this.numIndexTerms > 0, () => "numIndexTerms=" + numIndexTerms + " indexDivisor=" + outerInstance.outerInstance.indexDivisor);
+ if (Debugging.AssertsEnabled) Debugging.Assert(this.numIndexTerms > 0, () => "numIndexTerms=" + numIndexTerms + " indexDivisor=" + outerInstance.outerInstance.indexDivisor);
if (outerInstance.outerInstance.indexDivisor == 1)
{
@@ -345,11 +345,11 @@ namespace Lucene.Net.Codecs.BlockTerms
// records offsets into main terms dict file
termsDictOffsets = PackedInt32s.GetReader(clone);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termsDictOffsets.Count == numIndexTerms);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termsDictOffsets.Count == numIndexTerms);
// records offsets into byte[] term data
termOffsets = PackedInt32s.GetReader(clone);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termOffsets.Count == 1 + numIndexTerms);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termOffsets.Count == 1 + numIndexTerms);
}
finally
{
@@ -400,8 +400,8 @@ namespace Lucene.Net.Codecs.BlockTerms
clone.Seek(indexStart + termOffset);
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => indexStart + termOffset < clone.Length, () => "indexStart=" + indexStart + " termOffset=" + termOffset + " len=" + clone.Length);
- Debugging.Assert(() => indexStart + termOffset + numTermBytes < clone.Length);
+ Debugging.Assert(indexStart + termOffset < clone.Length, () => "indexStart=" + indexStart + " termOffset=" + termOffset + " len=" + clone.Length);
+ Debugging.Assert(indexStart + termOffset + numTermBytes < clone.Length);
}
outerInstance.outerInstance.termBytes.Copy(clone, numTermBytes);
diff --git a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
index ac25b8d..430365a 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
@@ -187,7 +187,7 @@ namespace Lucene.Net.Codecs.BlockTerms
lastTermsPointer = termsFilePointer;
// save term length (in bytes)
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexedTermLength <= short.MaxValue);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexedTermLength <= short.MaxValue);
termLengths[numIndexTerms] = (short)indexedTermLength;
totTermLength += indexedTermLength;
diff --git a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
index d6caa49..9bb67b5 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
@@ -55,7 +55,7 @@ namespace Lucene.Net.Codecs.BlockTerms
input = dir.OpenInput(IndexFileNames.SegmentFileName(segment, segmentSuffix, VariableGapTermsIndexWriter.TERMS_INDEX_EXTENSION), new IOContext(context, true));
//this.segment = segment; // LUCENENET: Not used
bool success = false;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexDivisor == -1 || indexDivisor > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexDivisor == -1 || indexDivisor > 0);
try
{
diff --git a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs
index db5c9a5..80fa33b 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs
@@ -292,7 +292,7 @@ namespace Lucene.Net.Codecs.BlockTerms
if (text.Length == 0)
{
// We already added empty string in ctor
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termsFilePointer == startTermsFilePointer);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termsFilePointer == startTermsFilePointer);
return;
}
int lengthSave = text.Length;
diff --git a/src/Lucene.Net.Codecs/Bloom/BloomFilteringPostingsFormat.cs b/src/Lucene.Net.Codecs/Bloom/BloomFilteringPostingsFormat.cs
index b2aaf1d..9f4cc05 100644
--- a/src/Lucene.Net.Codecs/Bloom/BloomFilteringPostingsFormat.cs
+++ b/src/Lucene.Net.Codecs/Bloom/BloomFilteringPostingsFormat.cs
@@ -380,7 +380,7 @@ namespace Lucene.Net.Codecs.Bloom
var bloomFilter = outerInstance._bloomFilterFactory.GetSetForField(_state, field);
if (bloomFilter != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (_bloomFilters.ContainsKey(field) == false));
+ if (Debugging.AssertsEnabled) Debugging.Assert((_bloomFilters.ContainsKey(field) == false));
_bloomFilters.Add(field, bloomFilter);
return new WrappedTermsConsumer(_delegateFieldsConsumer.AddField(field), bloomFilter);
diff --git a/src/Lucene.Net.Codecs/Bloom/FuzzySet.cs b/src/Lucene.Net.Codecs/Bloom/FuzzySet.cs
index 76c007a..c3cb2ce 100644
--- a/src/Lucene.Net.Codecs/Bloom/FuzzySet.cs
+++ b/src/Lucene.Net.Codecs/Bloom/FuzzySet.cs
@@ -228,7 +228,7 @@ namespace Lucene.Net.Codecs.Bloom
private ContainsResult MayContainValue(int positiveHash)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (positiveHash >= 0));
+ if (Debugging.AssertsEnabled) Debugging.Assert((positiveHash >= 0));
// Bloom sizes are always base 2 and so can be ANDed for a fast modulo
var pos = positiveHash & _bloomSize;
diff --git a/src/Lucene.Net.Codecs/IntBlock/FixedIntBlockIndexInput.cs b/src/Lucene.Net.Codecs/IntBlock/FixedIntBlockIndexInput.cs
index f0ce63c..d201869 100644
--- a/src/Lucene.Net.Codecs/IntBlock/FixedIntBlockIndexInput.cs
+++ b/src/Lucene.Net.Codecs/IntBlock/FixedIntBlockIndexInput.cs
@@ -109,7 +109,7 @@ namespace Lucene.Net.Codecs.IntBlock
internal virtual void Seek(long fp, int upto)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto < blockSize);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto < blockSize);
if (seekPending || fp != lastBlockFP)
{
pendingFP = fp;
@@ -173,7 +173,7 @@ namespace Lucene.Net.Codecs.IntBlock
fp += indexIn.ReadVInt64();
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto < outerInstance.m_blockSize);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto < outerInstance.m_blockSize);
}
public override void Seek(Int32IndexInput.Reader other)
diff --git a/src/Lucene.Net.Codecs/IntBlock/FixedIntBlockIndexOutput.cs b/src/Lucene.Net.Codecs/IntBlock/FixedIntBlockIndexOutput.cs
index 869b93a..d6bc3d4 100644
--- a/src/Lucene.Net.Codecs/IntBlock/FixedIntBlockIndexOutput.cs
+++ b/src/Lucene.Net.Codecs/IntBlock/FixedIntBlockIndexOutput.cs
@@ -101,7 +101,7 @@ namespace Lucene.Net.Codecs.IntBlock
else if (fp == lastFP)
{
// same block
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto >= lastUpto);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto >= lastUpto);
int uptoDelta = upto - lastUpto;
indexOut.WriteVInt32(uptoDelta << 1 | 1);
}
diff --git a/src/Lucene.Net.Codecs/IntBlock/VariableIntBlockIndexInput.cs b/src/Lucene.Net.Codecs/IntBlock/VariableIntBlockIndexInput.cs
index 3c90d8c..0a65f5a 100644
--- a/src/Lucene.Net.Codecs/IntBlock/VariableIntBlockIndexInput.cs
+++ b/src/Lucene.Net.Codecs/IntBlock/VariableIntBlockIndexInput.cs
@@ -118,7 +118,7 @@ namespace Lucene.Net.Codecs.IntBlock
// TODO: should we do this in real-time, not lazy?
pendingFP = fp;
pendingUpto = upto;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pendingUpto >= 0, () => "pendingUpto=" + pendingUpto);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pendingUpto >= 0, () => "pendingUpto=" + pendingUpto);
seekPending = true;
}
diff --git a/src/Lucene.Net.Codecs/IntBlock/VariableIntBlockIndexOutput.cs b/src/Lucene.Net.Codecs/IntBlock/VariableIntBlockIndexOutput.cs
index db3af9d..1bc8a78 100644
--- a/src/Lucene.Net.Codecs/IntBlock/VariableIntBlockIndexOutput.cs
+++ b/src/Lucene.Net.Codecs/IntBlock/VariableIntBlockIndexOutput.cs
@@ -107,7 +107,7 @@ namespace Lucene.Net.Codecs.IntBlock
public override void Write(DataOutput indexOut, bool absolute)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto >= 0);
if (absolute)
{
indexOut.WriteVInt32(upto);
@@ -116,7 +116,7 @@ namespace Lucene.Net.Codecs.IntBlock
else if (fp == lastFP)
{
// same block
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto >= lastUpto);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto >= lastUpto);
int uptoDelta = upto - lastUpto;
indexOut.WriteVInt32(uptoDelta << 1 | 1);
}
@@ -136,7 +136,7 @@ namespace Lucene.Net.Codecs.IntBlock
hitExcDuringWrite = true;
upto -= Add(v) - 1;
hitExcDuringWrite = false;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto >= 0);
}
protected override void Dispose(bool disposing)
@@ -152,7 +152,7 @@ namespace Lucene.Net.Codecs.IntBlock
while (upto > stuffed)
{
upto -= Add(0) - 1;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto >= 0);
stuffed += 1;
}
}
diff --git a/src/Lucene.Net.Codecs/Memory/DirectDocValuesConsumer.cs b/src/Lucene.Net.Codecs/Memory/DirectDocValuesConsumer.cs
index 2d92f3f..ecd18e8 100644
--- a/src/Lucene.Net.Codecs/Memory/DirectDocValuesConsumer.cs
+++ b/src/Lucene.Net.Codecs/Memory/DirectDocValuesConsumer.cs
@@ -372,7 +372,7 @@ namespace Lucene.Net.Codecs.Memory
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false);
return false;
}
}
diff --git a/src/Lucene.Net.Codecs/Memory/DirectDocValuesProducer.cs b/src/Lucene.Net.Codecs/Memory/DirectDocValuesProducer.cs
index 330237a..8df0270 100644
--- a/src/Lucene.Net.Codecs/Memory/DirectDocValuesProducer.cs
+++ b/src/Lucene.Net.Codecs/Memory/DirectDocValuesProducer.cs
@@ -552,7 +552,7 @@ namespace Lucene.Net.Codecs.Memory
{
var data = (IndexInput)this.data.Clone();
data.Seek(offset);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => length % 8 == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(length % 8 == 0);
var bits = new long[(int)length >> 3];
for (var i = 0; i < bits.Length; i++)
{
diff --git a/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs b/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
index 63c9a80..be7e794 100644
--- a/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
+++ b/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
@@ -589,7 +589,7 @@ namespace Lucene.Net.Codecs.Memory
upto++;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto == docFreq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto == docFreq);
ent = new HighFreqTerm(docs, freqs, positions, payloads, totalTermFreq);
}
@@ -625,7 +625,7 @@ namespace Lucene.Net.Codecs.Memory
}
}
this.skipOffsets[numTerms] = skipOffset;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => skipOffset == skipCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(skipOffset == skipCount);
}
/// <summary>Returns approximate RAM bytes used. </summary>
@@ -738,7 +738,7 @@ namespace Lucene.Net.Codecs.Memory
private void FinishSkips()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => count == terms.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(count == terms.Length);
int lastTermOffset = termOffsets[count - 1];
int lastTermLength = termOffsets[count] - lastTermOffset;
@@ -972,7 +972,7 @@ namespace Lucene.Net.Codecs.Memory
{
termOrd = (int) ((OrdTermState) state).Ord;
SetTerm();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => term.Equals(scratch));
+ if (Debugging.AssertsEnabled) Debugging.Assert(term.Equals(scratch));
}
public override BytesRef Term => scratch;
@@ -1207,15 +1207,15 @@ namespace Lucene.Net.Codecs.Memory
while (label > states[i].transitionMax)
{
states[i].transitionUpto++;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => states[i].transitionUpto < states[i].transitions.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(states[i].transitionUpto < states[i].transitions.Length);
states[i].transitionMin = states[i].transitions[states[i].transitionUpto].Min;
states[i].transitionMax = states[i].transitions[states[i].transitionUpto].Max;
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => states[i].transitionMin >= 0);
- Debugging.Assert(() => states[i].transitionMin <= 255);
- Debugging.Assert(() => states[i].transitionMax >= 0);
- Debugging.Assert(() => states[i].transitionMax <= 255);
+ Debugging.Assert(states[i].transitionMin >= 0);
+ Debugging.Assert(states[i].transitionMin <= 255);
+ Debugging.Assert(states[i].transitionMax >= 0);
+ Debugging.Assert(states[i].transitionMax <= 255);
}
}
@@ -1257,7 +1257,7 @@ namespace Lucene.Net.Codecs.Memory
// System.out.println(" no match; already beyond; return termOrd=" + termOrd);
// }
stateUpto -= skipUpto;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stateUpto >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stateUpto >= 0);
return;
}
else if (label == (outerInstance.termBytes[termOffset_i + i] & 0xFF))
@@ -1272,7 +1272,7 @@ namespace Lucene.Net.Codecs.Memory
int nextState = runAutomaton.Step(states[stateUpto].state, label);
// Automaton is required to accept startTerm:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextState != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextState != -1);
stateUpto++;
states[stateUpto].changeOrd = outerInstance.skips[skipOffset + skipUpto++];
@@ -1303,12 +1303,12 @@ namespace Lucene.Net.Codecs.Memory
while (termOrd < outerInstance.terms.Length &&
outerInstance.Compare(termOrd, startTerm) <= 0)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termOrd == startTermOrd ||
+ if (Debugging.AssertsEnabled) Debugging.Assert(termOrd == startTermOrd ||
outerInstance.skipOffsets[termOrd] ==
outerInstance.skipOffsets[termOrd + 1]);
termOrd++;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termOrd - startTermOrd < outerInstance.minSkipCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termOrd - startTermOrd < outerInstance.minSkipCount);
termOrd--;
stateUpto -= skipUpto;
// if (DEBUG) {
@@ -1389,7 +1389,7 @@ namespace Lucene.Net.Codecs.Memory
if (termOrd == 0 && outerInstance.termOffsets[1] == 0)
{
// Special-case empty string:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stateUpto == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stateUpto == 0);
// if (DEBUG) {
// System.out.println(" visit empty string");
// }
@@ -1438,9 +1438,9 @@ namespace Lucene.Net.Codecs.Memory
// System.out.println(" term=" + new BytesRef(termBytes, termOffset, termLength).utf8ToString() + " skips=" + Arrays.toString(skips));
// }
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termOrd < state.changeOrd);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termOrd < state.changeOrd);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stateUpto <= termLength, () => "term.length=" + termLength + "; stateUpto=" + stateUpto);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stateUpto <= termLength, () => "term.length=" + termLength + "; stateUpto=" + stateUpto);
int label = outerInstance.termBytes[termOffset + stateUpto] & 0xFF;
while (label > state.transitionMax)
@@ -1459,7 +1459,7 @@ namespace Lucene.Net.Codecs.Memory
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state.changeOrd > termOrd);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state.changeOrd > termOrd);
// if (DEBUG) {
// System.out.println(" jumpend " + (state.changeOrd - termOrd));
// }
@@ -1470,16 +1470,16 @@ namespace Lucene.Net.Codecs.Memory
}
goto nextTermContinue;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state.transitionUpto < state.transitions.Length,
+ if (Debugging.AssertsEnabled) Debugging.Assert(state.transitionUpto < state.transitions.Length,
() => " state.transitionUpto=" + state.transitionUpto + " vs " + state.transitions.Length);
state.transitionMin = state.transitions[state.transitionUpto].Min;
state.transitionMax = state.transitions[state.transitionUpto].Max;
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => state.transitionMin >= 0);
- Debugging.Assert(() => state.transitionMin <= 255);
- Debugging.Assert(() => state.transitionMax >= 0);
- Debugging.Assert(() => state.transitionMax <= 255);
+ Debugging.Assert(state.transitionMin >= 0);
+ Debugging.Assert(state.transitionMin <= 255);
+ Debugging.Assert(state.transitionMax >= 0);
+ Debugging.Assert(state.transitionMax <= 255);
}
}
@@ -1609,7 +1609,7 @@ namespace Lucene.Net.Codecs.Memory
if (compiledAutomaton.CommonSuffixRef != null)
{
//System.out.println("suffix " + compiledAutomaton.commonSuffixRef.utf8ToString());
- if (Debugging.AssertsEnabled) Debugging.Assert(() => compiledAutomaton.CommonSuffixRef.Offset == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(compiledAutomaton.CommonSuffixRef.Offset == 0);
if (termLength < compiledAutomaton.CommonSuffixRef.Length)
{
termOrd++;
@@ -2008,7 +2008,7 @@ namespace Lucene.Net.Codecs.Memory
if (upto < postings.Length)
{
freq = postings[upto + 1];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => freq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(freq > 0);
return postings[upto];
}
}
@@ -2017,7 +2017,7 @@ namespace Lucene.Net.Codecs.Memory
while (upto < postings.Length)
{
freq = postings[upto + 1];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => freq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(freq > 0);
if (liveDocs.Get(postings[upto]))
{
return postings[upto];
@@ -2192,7 +2192,7 @@ namespace Lucene.Net.Codecs.Memory
public override int NextPosition()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => skipPositions > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(skipPositions > 0);
skipPositions--;
int pos = postings[upto++];
diff --git a/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs b/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs
index 6d79270..c34bd4c 100644
--- a/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs
+++ b/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs
@@ -166,7 +166,7 @@ namespace Lucene.Net.Codecs.Memory
public override Terms GetTerms(string field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field != null);
TermsReader result;
fields.TryGetValue(field, out result);
return result;
@@ -218,7 +218,7 @@ namespace Lucene.Net.Codecs.Memory
this.longsSize = longsSize;
this.index = index;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (numTerms & (~0xffffffffL)) == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert((numTerms & (~0xffffffffL)) == 0);
int numBlocks = (int)(numTerms + INTERVAL - 1) / INTERVAL;
this.numSkipInfo = longsSize + 3;
this.skipInfo = new long[numBlocks * numSkipInfo];
@@ -500,7 +500,7 @@ namespace Lucene.Net.Codecs.Memory
{
seekPending = false;
var status = SeekCeil(term);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => status == SeekStatus.FOUND); // must positioned on valid term
+ if (Debugging.AssertsEnabled) Debugging.Assert(status == SeekStatus.FOUND); // must positioned on valid term
}
UpdateEnum(fstEnum.Next());
return term;
@@ -631,7 +631,7 @@ namespace Lucene.Net.Codecs.Memory
internal override void DecodeStats()
{
var arc = TopFrame().arc;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.NextFinalOutput == fstOutputs.NoOutput);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.NextFinalOutput == fstOutputs.NoOutput);
ord = arc.Output.Value;
base.DecodeStats();
}
@@ -699,7 +699,7 @@ namespace Lucene.Net.Codecs.Memory
{
break;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => IsValid(frame)); // target must be fetched from automaton
+ if (Debugging.AssertsEnabled) Debugging.Assert(IsValid(frame)); // target must be fetched from automaton
PushFrame(frame);
upto++;
}
@@ -837,7 +837,7 @@ namespace Lucene.Net.Codecs.Memory
arc.Output = fstOutputs.Add(TopFrame().arc.Output, arc.Output);
term = Grow(arc.Label);
level++;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => frame == stack[level]);
+ if (Debugging.AssertsEnabled) Debugging.Assert(frame == stack[level]);
}
private Frame PopFrame()
diff --git a/src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs b/src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs
index 16d2d0c..f072365 100644
--- a/src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs
+++ b/src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs
@@ -128,7 +128,7 @@ namespace Lucene.Net.Codecs.Memory
if (Equals(t1, NO_OUTPUT) || Equals(t2, NO_OUTPUT))
return NO_OUTPUT;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => t1.longs.Length == t2.longs.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(t1.longs.Length == t2.longs.Length);
long[] min = t1.longs, max = t2.longs;
int pos = 0;
@@ -183,7 +183,7 @@ namespace Lucene.Net.Codecs.Memory
if (Equals(t2, NO_OUTPUT))
return t1;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => t1.longs.Length == t2.longs.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(t1.longs.Length == t2.longs.Length);
int pos = 0;
long diff = 0;
@@ -220,7 +220,7 @@ namespace Lucene.Net.Codecs.Memory
if (Equals(t2, NO_OUTPUT))
return t1;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => t1.longs.Length == t2.longs.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(t1.longs.Length == t2.longs.Length);
var pos = 0;
var accum = new long[_longsSize];
diff --git a/src/Lucene.Net.Codecs/Memory/FSTTermsReader.cs b/src/Lucene.Net.Codecs/Memory/FSTTermsReader.cs
index e12eb5a..38d6da7 100644
--- a/src/Lucene.Net.Codecs/Memory/FSTTermsReader.cs
+++ b/src/Lucene.Net.Codecs/Memory/FSTTermsReader.cs
@@ -166,7 +166,7 @@ namespace Lucene.Net.Codecs.Memory
public override Terms GetTerms(string field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field != null);
TermsReader result;
fields.TryGetValue(field, out result);
return result;
@@ -369,7 +369,7 @@ namespace Lucene.Net.Codecs.Memory
{
seekPending = false;
SeekStatus status = SeekCeil(term);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => status == SeekStatus.FOUND); // must positioned on valid term
+ if (Debugging.AssertsEnabled) Debugging.Assert(status == SeekStatus.FOUND); // must positioned on valid term
}
UpdateEnum(fstEnum.Next());
return term;
@@ -500,7 +500,7 @@ namespace Lucene.Net.Codecs.Memory
internal override void DecodeMetaData()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => term != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(term != null);
if (!decoded)
{
if (meta.bytes != null)
@@ -611,7 +611,7 @@ namespace Lucene.Net.Codecs.Memory
{
break;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => IsValid(frame)); // target must be fetched from automaton
+ if (Debugging.AssertsEnabled) Debugging.Assert(IsValid(frame)); // target must be fetched from automaton
PushFrame(frame);
upto++;
}
diff --git a/src/Lucene.Net.Codecs/Memory/MemoryDocValuesConsumer.cs b/src/Lucene.Net.Codecs/Memory/MemoryDocValuesConsumer.cs
index 2176e99..cb6dc17 100644
--- a/src/Lucene.Net.Codecs/Memory/MemoryDocValuesConsumer.cs
+++ b/src/Lucene.Net.Codecs/Memory/MemoryDocValuesConsumer.cs
@@ -144,7 +144,7 @@ namespace Lucene.Net.Codecs.Memory
++count;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => count == maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(count == maxDoc);
}
if (missing)
diff --git a/src/Lucene.Net.Codecs/Memory/MemoryDocValuesProducer.cs b/src/Lucene.Net.Codecs/Memory/MemoryDocValuesProducer.cs
index 802ca19..535844f 100644
--- a/src/Lucene.Net.Codecs/Memory/MemoryDocValuesProducer.cs
+++ b/src/Lucene.Net.Codecs/Memory/MemoryDocValuesProducer.cs
@@ -675,7 +675,7 @@ namespace Lucene.Net.Codecs.Memory
{
var data = (IndexInput)this.data.Clone();
data.Seek(offset);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => length % 8 == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(length % 8 == 0);
var bits = new long[(int) length >> 3];
for (var i = 0; i < bits.Length; i++)
{
diff --git a/src/Lucene.Net.Codecs/Memory/MemoryPostingsFormat.cs b/src/Lucene.Net.Codecs/Memory/MemoryPostingsFormat.cs
index 7fa27bf..1bf2067 100644
--- a/src/Lucene.Net.Codecs/Memory/MemoryPostingsFormat.cs
+++ b/src/Lucene.Net.Codecs/Memory/MemoryPostingsFormat.cs
@@ -146,7 +146,7 @@ namespace Lucene.Net.Codecs.Memory
public override void StartDoc(int docID, int termDocFreq)
{
int delta = docID - lastDocID;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docID == 0 || delta > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docID == 0 || delta > 0);
lastDocID = docID;
docCount++;
@@ -161,7 +161,7 @@ namespace Lucene.Net.Codecs.Memory
else
{
buffer.WriteVInt32(delta << 1);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termDocFreq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termDocFreq > 0);
buffer.WriteVInt32(termDocFreq);
}
@@ -171,12 +171,12 @@ namespace Lucene.Net.Codecs.Memory
public override void AddPosition(int pos, BytesRef payload, int startOffset, int endOffset)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => payload == null || outerInstance.field.HasPayloads);
+ if (Debugging.AssertsEnabled) Debugging.Assert(payload == null || outerInstance.field.HasPayloads);
//System.out.println(" addPos pos=" + pos + " payload=" + payload);
int delta = pos - lastPos;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => delta >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(delta >= 0);
lastPos = pos;
int payloadLen = 0;
@@ -231,7 +231,7 @@ namespace Lucene.Net.Codecs.Memory
public virtual PostingsWriter Reset()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => buffer.GetFilePointer() == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(buffer.GetFilePointer() == 0);
lastDocID = 0;
docCount = 0;
lastPayloadLen = 0;
@@ -255,9 +255,9 @@ namespace Lucene.Net.Codecs.Memory
public override void FinishTerm(BytesRef text, TermStats stats)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => postingsWriter.docCount == stats.DocFreq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(postingsWriter.docCount == stats.DocFreq);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => buffer2.GetFilePointer() == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(buffer2.GetFilePointer() == 0);
buffer2.WriteVInt32(stats.DocFreq);
if (field.IndexOptions != IndexOptions.DOCS_ONLY)
@@ -402,7 +402,7 @@ namespace Lucene.Net.Codecs.Memory
public FSTDocsEnum Reset(BytesRef bufferIn, IBits liveDocs, int numDocs)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numDocs > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numDocs > 0);
if (buffer.Length < bufferIn.Length)
{
buffer = ArrayUtil.Grow(buffer, bufferIn.Length);
@@ -446,7 +446,7 @@ namespace Lucene.Net.Codecs.Memory
else
{
freq = @in.ReadVInt32();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => freq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(freq > 0);
}
if (indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS)
@@ -555,7 +555,7 @@ namespace Lucene.Net.Codecs.Memory
public FSTDocsAndPositionsEnum Reset(BytesRef bufferIn, IBits liveDocs, int numDocs)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numDocs > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numDocs > 0);
// System.out.println("D&P reset bytes this=" + this);
// for(int i=bufferIn.offset;i<bufferIn.length;i++) {
@@ -606,7 +606,7 @@ namespace Lucene.Net.Codecs.Memory
else
{
freq = @in.ReadVInt32();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => freq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(freq > 0);
}
if (liveDocs == null || liveDocs.Get(accum))
@@ -655,7 +655,7 @@ namespace Lucene.Net.Codecs.Memory
public override int NextPosition()
{
//System.out.println(" nextPos storePayloads=" + storePayloads + " this=" + this);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => posPending > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(posPending > 0);
posPending--;
if (!storePayloads)
{
diff --git a/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsFormat.cs b/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsFormat.cs
index 8f61c25..f91fb84 100644
--- a/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsFormat.cs
+++ b/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsFormat.cs
@@ -47,7 +47,7 @@ namespace Lucene.Net.Codecs.Pulsing
int minBlockSize, int maxBlockSize)
: base()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => minBlockSize > 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(minBlockSize > 1);
_freqCutoff = freqCutoff;
_minBlockSize = minBlockSize;
diff --git a/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsReader.cs b/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsReader.cs
index b7568b2..d429bd6 100644
--- a/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsReader.cs
+++ b/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsReader.cs
@@ -122,7 +122,7 @@ namespace Lucene.Net.Codecs.Pulsing
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => WrappedTermState != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(WrappedTermState != null);
clone.WrappedTermState = (BlockTermState)WrappedTermState.Clone();
clone.Absolute = Absolute;
@@ -172,7 +172,7 @@ namespace Lucene.Net.Codecs.Pulsing
{
var termState2 = (PulsingTermState) termState;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => empty.Length == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(empty.Length == 0);
termState2.Absolute = termState2.Absolute || absolute;
// if we have positions, its total TF, otherwise its computed based on docFreq.
@@ -340,7 +340,7 @@ namespace Lucene.Net.Codecs.Pulsing
public virtual PulsingDocsEnum Reset(IBits liveDocs, PulsingTermState termState)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termState.PostingsSize != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termState.PostingsSize != -1);
// Must make a copy of termState's byte[] so that if
// app does TermsEnum.next(), this DocsEnum is not affected
@@ -482,7 +482,7 @@ namespace Lucene.Net.Codecs.Pulsing
public virtual PulsingDocsAndPositionsEnum Reset(IBits liveDocs, PulsingTermState termState)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termState.PostingsSize != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termState.PostingsSize != -1);
if (_postingsBytes == null)
{
@@ -542,7 +542,7 @@ namespace Lucene.Net.Codecs.Pulsing
public override int NextPosition()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _posPending > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_posPending > 0);
_posPending--;
diff --git a/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsWriter.cs b/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsWriter.cs
index f1b0ec5..e01618d 100644
--- a/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsWriter.cs
+++ b/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsWriter.cs
@@ -150,7 +150,7 @@ namespace Lucene.Net.Codecs.Pulsing
public override void StartTerm()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _pendingCount == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_pendingCount == 0);
}
// TODO: -- should we NOT reuse across fields? would
@@ -175,7 +175,7 @@ namespace Lucene.Net.Codecs.Pulsing
public override void StartDoc(int docId, int termDocFreq)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docId >= 0, () => "Got DocID=" + docId);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docId >= 0, () => "Got DocID=" + docId);
if (_pendingCount == _pending.Length)
{
@@ -185,7 +185,7 @@ namespace Lucene.Net.Codecs.Pulsing
if (_pendingCount != -1)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _pendingCount < _pending.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_pendingCount < _pending.Length);
_currentDoc = _pending[_pendingCount];
_currentDoc.docID = docId;
if (_indexOptions == IndexOptions.DOCS_ONLY)
@@ -267,7 +267,7 @@ namespace Lucene.Net.Codecs.Pulsing
{
var state2 = (PulsingTermState)state;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _pendingCount > 0 || _pendingCount == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_pendingCount > 0 || _pendingCount == -1);
if (_pendingCount == -1)
{
@@ -318,7 +318,7 @@ namespace Lucene.Net.Codecs.Pulsing
for (var posIDX = 0; posIDX < doc.termFreq; posIDX++)
{
var pos = _pending[pendingIDX++];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pos.docID == doc.docID);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pos.docID == doc.docID);
var posDelta = pos.pos - lastPos;
lastPos = pos.pos;
@@ -361,7 +361,7 @@ namespace Lucene.Net.Codecs.Pulsing
if (payloadLength > 0)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _storePayloads);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_storePayloads);
_buffer.WriteBytes(pos.payload.Bytes, 0, pos.payload.Length);
}
}
@@ -375,7 +375,7 @@ namespace Lucene.Net.Codecs.Pulsing
Position doc = _pending[posIdx];
int delta = doc.docID - lastDocId;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => doc.termFreq != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(doc.termFreq != 0);
if (doc.termFreq == 1)
{
@@ -411,7 +411,7 @@ namespace Lucene.Net.Codecs.Pulsing
bool abs)
{
var _state = (PulsingTermState)state;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => empty.Length == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(empty.Length == 0);
_absolute = _absolute || abs;
if (_state.bytes == null)
{
@@ -469,7 +469,7 @@ namespace Lucene.Net.Codecs.Pulsing
/// </summary>
private void Push()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _pendingCount == _pending.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_pendingCount == _pending.Length);
_wrappedPostingsWriter.StartTerm();
@@ -487,7 +487,7 @@ namespace Lucene.Net.Codecs.Pulsing
}
else if (doc.docID != pos.docID)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pos.docID > doc.docID);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pos.docID > doc.docID);
_wrappedPostingsWriter.FinishDoc();
doc = pos;
_wrappedPostingsWriter.StartDoc(doc.docID, doc.termFreq);
diff --git a/src/Lucene.Net.Codecs/Sep/SepPostingsReader.cs b/src/Lucene.Net.Codecs/Sep/SepPostingsReader.cs
index dad545a..b6565cf 100644
--- a/src/Lucene.Net.Codecs/Sep/SepPostingsReader.cs
+++ b/src/Lucene.Net.Codecs/Sep/SepPostingsReader.cs
@@ -263,7 +263,7 @@ namespace Lucene.Net.Codecs.Sep
public override DocsAndPositionsEnum DocsAndPositions(FieldInfo fieldInfo, BlockTermState termState,
IBits liveDocs, DocsAndPositionsEnum reuse, DocsAndPositionsFlags flags)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldInfo.IndexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldInfo.IndexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
SepTermState termState_ = (SepTermState)termState;
SepDocsAndPositionsEnum postingsEnum;
if (reuse == null || !(reuse is SepDocsAndPositionsEnum))
@@ -692,7 +692,7 @@ namespace Lucene.Net.Codecs.Sep
{
// Payload length has changed
payloadLength = posReader.Next();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => payloadLength >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(payloadLength >= 0);
}
pendingPosCount--;
position = 0;
@@ -707,7 +707,7 @@ namespace Lucene.Net.Codecs.Sep
{
// Payload length has changed
payloadLength = posReader.Next();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => payloadLength >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(payloadLength >= 0);
}
position += (int)(((uint)code) >> 1);
pendingPayloadBytes += payloadLength;
@@ -719,7 +719,7 @@ namespace Lucene.Net.Codecs.Sep
}
pendingPosCount--;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pendingPosCount >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pendingPosCount >= 0);
return position;
}
@@ -741,7 +741,7 @@ namespace Lucene.Net.Codecs.Sep
return payload;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pendingPayloadBytes >= payloadLength);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pendingPayloadBytes >= payloadLength);
if (pendingPayloadBytes > payloadLength)
{
diff --git a/src/Lucene.Net.Codecs/Sep/SepPostingsWriter.cs b/src/Lucene.Net.Codecs/Sep/SepPostingsWriter.cs
index e460fde..f4b2d13 100644
--- a/src/Lucene.Net.Codecs/Sep/SepPostingsWriter.cs
+++ b/src/Lucene.Net.Codecs/Sep/SepPostingsWriter.cs
@@ -262,10 +262,10 @@ namespace Lucene.Net.Codecs.Sep
/// Add a new position & payload. </summary>
public override void AddPosition(int position, BytesRef payload, int startOffset, int endOffset)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
int delta = position - lastPosition;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => delta >= 0, () => "position=" + position + " lastPosition=" + lastPosition); // not quite right (if pos=0 is repeated twice we don't catch it)
+ if (Debugging.AssertsEnabled) Debugging.Assert(delta >= 0, () => "position=" + position + " lastPosition=" + lastPosition); // not quite right (if pos=0 is repeated twice we don't catch it)
lastPosition = position;
if (storePayloads)
@@ -319,8 +319,8 @@ namespace Lucene.Net.Codecs.Sep
// TODO: -- wasteful we are counting this in two places?
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => state_.DocFreq > 0);
- Debugging.Assert(() => state_.DocFreq == df);
+ Debugging.Assert(state_.DocFreq > 0);
+ Debugging.Assert(state_.DocFreq == df);
}
state_.DocIndex = docOut.GetIndex();
diff --git a/src/Lucene.Net.Codecs/Sep/SepSkipListReader.cs b/src/Lucene.Net.Codecs/Sep/SepSkipListReader.cs
index b7c50ef..ab7af41 100644
--- a/src/Lucene.Net.Codecs/Sep/SepSkipListReader.cs
+++ b/src/Lucene.Net.Codecs/Sep/SepSkipListReader.cs
@@ -195,7 +195,7 @@ namespace Lucene.Net.Codecs.Sep
protected override int ReadSkipData(int level, IndexInput skipStream)
{
int delta;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS || !currentFieldStoresPayloads);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS || !currentFieldStoresPayloads);
if (currentFieldStoresPayloads)
{
// the current field stores payloads.
diff --git a/src/Lucene.Net.Codecs/Sep/SepSkipListWriter.cs b/src/Lucene.Net.Codecs/Sep/SepSkipListWriter.cs
index 2ef7094..f65b922 100644
--- a/src/Lucene.Net.Codecs/Sep/SepSkipListWriter.cs
+++ b/src/Lucene.Net.Codecs/Sep/SepSkipListWriter.cs
@@ -178,7 +178,7 @@ namespace Lucene.Net.Codecs.Sep
// current payload length equals the length at the previous
// skip point
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS || !curStorePayloads);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS || !curStorePayloads);
if (curStorePayloads)
{
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs
index 2123bd4..47ffc15 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs
@@ -76,25 +76,25 @@ namespace Lucene.Net.Codecs.SimpleText
{
break;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StartsWith(SimpleTextDocValuesWriter.FIELD), () => scratch.Utf8ToString());
+ if (Debugging.AssertsEnabled) Debugging.Assert(StartsWith(SimpleTextDocValuesWriter.FIELD), () => scratch.Utf8ToString());
var fieldName = StripPrefix(SimpleTextDocValuesWriter.FIELD);
var field = new OneField();
fields[fieldName] = field;
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StartsWith(SimpleTextDocValuesWriter.TYPE), () => scratch.Utf8ToString());
+ if (Debugging.AssertsEnabled) Debugging.Assert(StartsWith(SimpleTextDocValuesWriter.TYPE), () => scratch.Utf8ToString());
var dvType = (DocValuesType)Enum.Parse(typeof(DocValuesType), StripPrefix(SimpleTextDocValuesWriter.TYPE));
- // if (Debugging.AssertsEnabled) Debugging.Assert(() => dvType != null); // LUCENENET: Not possible for an enum to be null in .NET
+ // if (Debugging.AssertsEnabled) Debugging.Assert(dvType != null); // LUCENENET: Not possible for an enum to be null in .NET
if (dvType == DocValuesType.NUMERIC)
{
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StartsWith(SimpleTextDocValuesWriter.MINVALUE),
+ if (Debugging.AssertsEnabled) Debugging.Assert(StartsWith(SimpleTextDocValuesWriter.MINVALUE),
() => "got " + scratch.Utf8ToString() + " field=" + fieldName + " ext=" + ext);
field.MinValue = Convert.ToInt64(StripPrefix(SimpleTextDocValuesWriter.MINVALUE), CultureInfo.InvariantCulture);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StartsWith(SimpleTextDocValuesWriter.PATTERN));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StartsWith(SimpleTextDocValuesWriter.PATTERN));
field.Pattern = StripPrefix(SimpleTextDocValuesWriter.PATTERN);
field.DataStartFilePointer = data.GetFilePointer();
data.Seek(data.GetFilePointer() + (1 + field.Pattern.Length + 2)*maxDoc);
@@ -102,10 +102,10 @@ namespace Lucene.Net.Codecs.SimpleText
else if (dvType == DocValuesType.BINARY)
{
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StartsWith(SimpleTextDocValuesWriter.MAXLENGTH));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StartsWith(SimpleTextDocValuesWriter.MAXLENGTH));
field.MaxLength = Convert.ToInt32(StripPrefix(SimpleTextDocValuesWriter.MAXLENGTH), CultureInfo.InvariantCulture);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StartsWith(SimpleTextDocValuesWriter.PATTERN));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StartsWith(SimpleTextDocValuesWriter.PATTERN));
field.Pattern = StripPrefix(SimpleTextDocValuesWriter.PATTERN);
field.DataStartFilePointer = data.GetFilePointer();
data.Seek(data.GetFilePointer() + (9 + field.Pattern.Length + field.MaxLength + 2)*maxDoc);
@@ -113,16 +113,16 @@ namespace Lucene.Net.Codecs.SimpleText
else if (dvType == DocValuesType.SORTED || dvType == DocValuesType.SORTED_SET)
{
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StartsWith(SimpleTextDocValuesWriter.NUMVALUES));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StartsWith(SimpleTextDocValuesWriter.NUMVALUES));
field.NumValues = Convert.ToInt64(StripPrefix(SimpleTextDocValuesWriter.NUMVALUES), CultureInfo.InvariantCulture);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StartsWith(SimpleTextDocValuesWriter.MAXLENGTH));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StartsWith(SimpleTextDocValuesWriter.MAXLENGTH));
field.MaxLength = Convert.ToInt32(StripPrefix(SimpleTextDocValuesWriter.MAXLENGTH), CultureInfo.InvariantCulture);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StartsWith(SimpleTextDocValuesWriter.PATTERN));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StartsWith(SimpleTextDocValuesWriter.PATTERN));
field.Pattern = StripPrefix(SimpleTextDocValuesWriter.PATTERN);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StartsWith(SimpleTextDocValuesWriter.ORDPATTERN));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StartsWith(SimpleTextDocValuesWriter.ORDPATTERN));
field.OrdPattern = StripPrefix(SimpleTextDocValuesWriter.ORDPATTERN);
field.DataStartFilePointer = data.GetFilePointer();
data.Seek(data.GetFilePointer() + (9 + field.Pattern.Length + field.MaxLength)*field.NumValues +
@@ -136,7 +136,7 @@ namespace Lucene.Net.Codecs.SimpleText
// We should only be called from above if at least one
// field has DVs:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fields.Count > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fields.Count > 0);
}
public override NumericDocValues GetNumeric(FieldInfo fieldInfo)
@@ -144,10 +144,10 @@ namespace Lucene.Net.Codecs.SimpleText
var field = fields[fieldInfo.Name];
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => field != null);
+ Debugging.Assert(field != null);
// SegmentCoreReaders already verifies this field is valid:
- Debugging.Assert(() => field != null, () => "field=" + fieldInfo.Name + " fields=" + fields);
+ Debugging.Assert(field != null, () => "field=" + fieldInfo.Name + " fields=" + fields);
}
var @in = (IndexInput)data.Clone();
@@ -244,7 +244,7 @@ namespace Lucene.Net.Codecs.SimpleText
public override BinaryDocValues GetBinary(FieldInfo fieldInfo)
{
var field = fields[fieldInfo.Name];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field != null);
var input = (IndexInput)data.Clone();
var scratch = new BytesRef();
@@ -278,7 +278,7 @@ namespace Lucene.Net.Codecs.SimpleText
_input.Seek(_field.DataStartFilePointer + (9 + _field.Pattern.Length + _field.MaxLength + 2) * docId);
SimpleTextUtil.ReadLine(_input, _scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextDocValuesWriter.LENGTH));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextDocValuesWriter.LENGTH));
int len;
try
{
@@ -335,7 +335,7 @@ namespace Lucene.Net.Codecs.SimpleText
{
_input.Seek(_field.DataStartFilePointer + (9 + _field.Pattern.Length + _field.MaxLength + 2) * index);
SimpleTextUtil.ReadLine(_input, _scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextDocValuesWriter.LENGTH));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextDocValuesWriter.LENGTH));
int len;
try
{
@@ -368,7 +368,7 @@ namespace Lucene.Net.Codecs.SimpleText
var field = fields[fieldInfo.Name];
// SegmentCoreReaders already verifies this field is valid:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field != null);
var input = (IndexInput)data.Clone();
var scratch = new BytesRef();
@@ -437,7 +437,7 @@ namespace Lucene.Net.Codecs.SimpleText
}
_input.Seek(_field.DataStartFilePointer + ord * (9 + _field.Pattern.Length + _field.MaxLength));
SimpleTextUtil.ReadLine(_input, _scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextDocValuesWriter.LENGTH),
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextDocValuesWriter.LENGTH),
() => "got " + _scratch.Utf8ToString() + " in=" + _input);
int len;
try
@@ -473,7 +473,7 @@ namespace Lucene.Net.Codecs.SimpleText
// SegmentCoreReaders already verifies this field is
// valid:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field != null);
var input = (IndexInput) data.Clone();
var scratch = new BytesRef();
@@ -542,7 +542,7 @@ namespace Lucene.Net.Codecs.SimpleText
_input.Seek(_field.DataStartFilePointer + ord * (9 + _field.Pattern.Length + _field.MaxLength));
SimpleTextUtil.ReadLine(_input, _scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextDocValuesWriter.LENGTH),
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextDocValuesWriter.LENGTH),
() => "got " + _scratch.Utf8ToString() + " in=" + _input);
int len;
try
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesWriter.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesWriter.cs
index e7bc522..8ca1703 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesWriter.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesWriter.cs
@@ -69,7 +69,7 @@ namespace Lucene.Net.Codecs.SimpleText
/// </summary>
private bool FieldSeen(string field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !_fieldsSeen.Contains(field), () => "field \"" + field + "\" was added more than once during flush");
+ if (Debugging.AssertsEnabled) Debugging.Assert(!_fieldsSeen.Contains(field), () => "field \"" + field + "\" was added more than once during flush");
_fieldsSeen.Add(field);
return true;
}
@@ -78,8 +78,8 @@ namespace Lucene.Net.Codecs.SimpleText
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => FieldSeen(field.Name));
- Debugging.Assert(() => field.DocValuesType == DocValuesType.NUMERIC ||
+ Debugging.Assert(FieldSeen(field.Name));
+ Debugging.Assert(field.DocValuesType == DocValuesType.NUMERIC ||
field.NormType == DocValuesType.NUMERIC);
}
WriteFieldEntry(field, DocValuesType.NUMERIC);
@@ -121,28 +121,28 @@ namespace Lucene.Net.Codecs.SimpleText
{
long value = n.GetValueOrDefault();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => value >= minValue);
+ if (Debugging.AssertsEnabled) Debugging.Assert(value >= minValue);
var delta = (decimal)value - (decimal)minValue; // LUCENENET specific - use decimal rather than BigInteger
string s = delta.ToString(patternString, CultureInfo.InvariantCulture);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => s.Length == patternString.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(s.Length == patternString.Length);
SimpleTextUtil.Write(data, s, scratch);
SimpleTextUtil.WriteNewline(data);
SimpleTextUtil.Write(data, n == null ? "F" : "T", scratch);
SimpleTextUtil.WriteNewline(data);
numDocsWritten++;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numDocsWritten <= numDocs);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numDocsWritten <= numDocs);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numDocs == numDocsWritten, () => "numDocs=" + numDocs + " numDocsWritten=" + numDocsWritten);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numDocs == numDocsWritten, () => "numDocs=" + numDocs + " numDocsWritten=" + numDocsWritten);
}
public override void AddBinaryField(FieldInfo field, IEnumerable<BytesRef> values)
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => FieldSeen(field.Name));
- Debugging.Assert(() => field.DocValuesType == DocValuesType.BINARY);
+ Debugging.Assert(FieldSeen(field.Name));
+ Debugging.Assert(field.DocValuesType == DocValuesType.BINARY);
}
var maxLength = 0;
@@ -198,15 +198,15 @@ namespace Lucene.Net.Codecs.SimpleText
numDocsWritten++;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numDocs == numDocsWritten);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numDocs == numDocsWritten);
}
public override void AddSortedField(FieldInfo field, IEnumerable<BytesRef> values, IEnumerable<long?> docToOrd)
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => FieldSeen(field.Name));
- Debugging.Assert(() => field.DocValuesType == DocValuesType.SORTED);
+ Debugging.Assert(FieldSeen(field.Name));
+ Debugging.Assert(field.DocValuesType == DocValuesType.SORTED);
}
WriteFieldEntry(field, DocValuesType.SORTED);
@@ -277,10 +277,10 @@ namespace Lucene.Net.Codecs.SimpleText
}
SimpleTextUtil.WriteNewline(data);
valuesSeen++;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valuesSeen <= valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(valuesSeen <= valueCount);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valuesSeen == valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(valuesSeen == valueCount);
foreach (var ord in docToOrd)
{
@@ -294,8 +294,8 @@ namespace Lucene.Net.Codecs.SimpleText
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => FieldSeen(field.Name));
- Debugging.Assert(() => field.DocValuesType == DocValuesType.SORTED_SET);
+ Debugging.Assert(FieldSeen(field.Name));
+ Debugging.Assert(field.DocValuesType == DocValuesType.SORTED_SET);
}
WriteFieldEntry(field, DocValuesType.SORTED_SET);
@@ -387,10 +387,10 @@ namespace Lucene.Net.Codecs.SimpleText
}
SimpleTextUtil.WriteNewline(data);
valuesSeen++;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valuesSeen <= valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(valuesSeen <= valueCount);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valuesSeen == valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(valuesSeen == valueCount);
using (var ordStream = ords.GetEnumerator())
{
@@ -438,7 +438,7 @@ namespace Lucene.Net.Codecs.SimpleText
var success = false;
try
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _fieldsSeen.Count > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_fieldsSeen.Count > 0);
// java : sheisty to do this here?
SimpleTextUtil.Write(data, END);
SimpleTextUtil.WriteNewline(data);
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs
index e9a68b0..a7c423a 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs
@@ -57,29 +57,29 @@ namespace Lucene.Net.Codecs.SimpleText
{
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NUMFIELDS));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NUMFIELDS));
var size = Convert.ToInt32(ReadString(SimpleTextFieldInfosWriter.NUMFIELDS.Length, scratch), CultureInfo.InvariantCulture);
var infos = new FieldInfo[size];
for (var i = 0; i < size; i++)
{
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NAME));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NAME));
string name = ReadString(SimpleTextFieldInfosWriter.NAME.Length, scratch);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NUMBER));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NUMBER));
int fieldNumber = Convert.ToInt32(ReadString(SimpleTextFieldInfosWriter.NUMBER.Length, scratch), CultureInfo.InvariantCulture);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.ISINDEXED));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.ISINDEXED));
bool isIndexed = Convert.ToBoolean(ReadString(SimpleTextFieldInfosWriter.ISINDEXED.Length, scratch), CultureInfo.InvariantCulture);
IndexOptions indexOptions;
if (isIndexed)
{
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.INDEXOPTIONS));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.INDEXOPTIONS));
indexOptions = (IndexOptions)Enum.Parse(typeof(IndexOptions), ReadString(SimpleTextFieldInfosWriter.INDEXOPTIONS.Length,
scratch));
}
@@ -89,46 +89,46 @@ namespace Lucene.Net.Codecs.SimpleText
}
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.STORETV));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.STORETV));
bool storeTermVector =
Convert.ToBoolean(ReadString(SimpleTextFieldInfosWriter.STORETV.Length, scratch), CultureInfo.InvariantCulture);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.PAYLOADS));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.PAYLOADS));
bool storePayloads =
Convert.ToBoolean(ReadString(SimpleTextFieldInfosWriter.PAYLOADS.Length, scratch), CultureInfo.InvariantCulture);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NORMS));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NORMS));
bool omitNorms = !Convert.ToBoolean(ReadString(SimpleTextFieldInfosWriter.NORMS.Length, scratch), CultureInfo.InvariantCulture);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NORMS_TYPE));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NORMS_TYPE));
string nrmType = ReadString(SimpleTextFieldInfosWriter.NORMS_TYPE.Length, scratch);
Index.DocValuesType normsType = DocValuesType(nrmType);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.DOCVALUES));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.DOCVALUES));
string dvType = ReadString(SimpleTextFieldInfosWriter.DOCVALUES.Length, scratch);
Index.DocValuesType docValuesType = DocValuesType(dvType);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.DOCVALUES_GEN));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.DOCVALUES_GEN));
long dvGen = Convert.ToInt64(ReadString(SimpleTextFieldInfosWriter.DOCVALUES_GEN.Length, scratch), CultureInfo.InvariantCulture);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NUM_ATTS));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.NUM_ATTS));
int numAtts = Convert.ToInt32(ReadString(SimpleTextFieldInfosWriter.NUM_ATTS.Length, scratch), CultureInfo.InvariantCulture);
IDictionary<string, string> atts = new Dictionary<string, string>();
for (int j = 0; j < numAtts; j++)
{
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.ATT_KEY));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.ATT_KEY));
string key = ReadString(SimpleTextFieldInfosWriter.ATT_KEY.Length, scratch);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.ATT_VALUE));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextFieldInfosWriter.ATT_VALUE));
string value = ReadString(SimpleTextFieldInfosWriter.ATT_VALUE.Length, scratch);
atts[key] = value;
}
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosWriter.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosWriter.cs
index 949c682..7abfdcc 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosWriter.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosWriter.cs
@@ -92,7 +92,7 @@ namespace Lucene.Net.Codecs.SimpleText
if (fi.IsIndexed)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi.IndexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0 || !fi.HasPayloads);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi.IndexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0 || !fi.HasPayloads);
SimpleTextUtil.Write(output, INDEXOPTIONS);
SimpleTextUtil.Write(output,
fi.IndexOptions != IndexOptions.NONE ? fi.IndexOptions.ToString() : string.Empty,
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsReader.cs
index 7e0c8d0..9a2a97b 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsReader.cs
@@ -159,7 +159,7 @@ namespace Lucene.Net.Codecs.SimpleText
public override BytesRef Next()
{
- //if (Debugging.AssertsEnabled) Debugging.Assert(() => !ended); // LUCENENET: Ended field is never set, so this can never fail
+ //if (Debugging.AssertsEnabled) Debugging.Assert(!ended); // LUCENENET: Ended field is never set, so this can never fail
var result = _fstEnum.Next();
if (result == null) return null;
@@ -316,8 +316,7 @@ namespace Lucene.Net.Codecs.SimpleText
else
{
if (Debugging.AssertsEnabled) Debugging.Assert(
- () => StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.TERM) || StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.FIELD) ||
- // LUCENENET TODO: This assert fails sometimes, which in turns causes _scratch.Utf8ToString() to throw an index out of range exception
+ StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.TERM) || StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.FIELD) ||
StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.END), () => "scratch=" + _scratch.Utf8ToString());
if (!first && (_liveDocs == null || _liveDocs.Get(_docId)))
@@ -446,7 +445,7 @@ namespace Lucene.Net.Codecs.SimpleText
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.TERM) || StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.FIELD) ||
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.TERM) || StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.FIELD) ||
StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.END));
if (!first && (_liveDocs == null || _liveDocs.Get(_docId)))
@@ -472,7 +471,7 @@ namespace Lucene.Net.Codecs.SimpleText
if (_readPositions)
{
SimpleTextUtil.ReadLine(_in, _scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.POS), () => "got line=" + _scratch.Utf8ToString());
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.POS), () => "got line=" + _scratch.Utf8ToString());
UnicodeUtil.UTF8toUTF16(_scratch.Bytes, _scratch.Offset + SimpleTextFieldsWriter.POS.Length, _scratch.Length - SimpleTextFieldsWriter.POS.Length,
_scratchUtf162);
pos = ArrayUtil.ParseInt32(_scratchUtf162.Chars, 0, _scratchUtf162.Length);
@@ -485,12 +484,12 @@ namespace Lucene.Net.Codecs.SimpleText
if (_readOffsets)
{
SimpleTextUtil.ReadLine(_in, _scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.START_OFFSET), () => "got line=" + _scratch.Utf8ToString());
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.START_OFFSET), () => "got line=" + _scratch.Utf8ToString());
UnicodeUtil.UTF8toUTF16(_scratch.Bytes, _scratch.Offset + SimpleTextFieldsWriter.START_OFFSET.Length,
_scratch.Length - SimpleTextFieldsWriter.START_OFFSET.Length, _scratchUtf162);
_startOffset = ArrayUtil.ParseInt32(_scratchUtf162.Chars, 0, _scratchUtf162.Length);
SimpleTextUtil.ReadLine(_in, _scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.END_OFFSET), () => "got line=" + _scratch.Utf8ToString());
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextFieldsWriter.END_OFFSET), () => "got line=" + _scratch.Utf8ToString());
UnicodeUtil.UTF8toUTF16(_scratch.Bytes, _scratch.Offset + SimpleTextFieldsWriter.END_OFFSET.Length,
_scratch.Length - SimpleTextFieldsWriter.END_OFFSET.Length, _scratchUtf162);
_endOffset = ArrayUtil.ParseInt32(_scratchUtf162.Chars, 0, _scratchUtf162.Length);
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsWriter.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsWriter.cs
index 31b85d9..9f39526 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsWriter.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsWriter.cs
@@ -165,8 +165,8 @@ namespace Lucene.Net.Codecs.SimpleText
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => endOffset >= startOffset);
- Debugging.Assert(() => startOffset >= _lastStartOffset,
+ Debugging.Assert(endOffset >= startOffset);
+ Debugging.Assert(startOffset >= _lastStartOffset,
() => "startOffset=" + startOffset + " lastStartOffset=" + _lastStartOffset);
}
_lastStartOffset = startOffset;
@@ -180,7 +180,7 @@ namespace Lucene.Net.Codecs.SimpleText
if (payload != null && payload.Length > 0)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => payload.Length != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(payload.Length != 0);
_outerInstance.Write(PAYLOAD);
_outerInstance.Write(payload);
_outerInstance.Newline();
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextLiveDocsFormat.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextLiveDocsFormat.cs
index 0c2c553..bf1aaa5 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextLiveDocsFormat.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextLiveDocsFormat.cs
@@ -67,7 +67,7 @@ namespace Lucene.Net.Codecs.SimpleText
public override IBits ReadLiveDocs(Directory dir, SegmentCommitInfo info, IOContext context)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => info.HasDeletions);
+ if (Debugging.AssertsEnabled) Debugging.Assert(info.HasDeletions);
var scratch = new BytesRef();
var scratchUtf16 = new CharsRef();
@@ -80,7 +80,7 @@ namespace Lucene.Net.Codecs.SimpleText
input = dir.OpenChecksumInput(fileName, context);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SIZE));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SIZE));
var size = ParseInt32At(scratch, SIZE.Length, scratchUtf16);
var bits = new BitSet(size);
@@ -88,7 +88,7 @@ namespace Lucene.Net.Codecs.SimpleText
SimpleTextUtil.ReadLine(input, scratch);
while (!scratch.Equals(END))
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, DOC));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, DOC));
var docid = ParseInt32At(scratch, DOC.Length, scratchUtf16);
bits.Set(docid);
SimpleTextUtil.ReadLine(input, scratch);
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextSegmentInfoReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextSegmentInfoReader.cs
index 8fdf142..3bcae92 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextSegmentInfoReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextSegmentInfoReader.cs
@@ -53,43 +53,43 @@ namespace Lucene.Net.Codecs.SimpleText
try
{
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_VERSION));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_VERSION));
string version = ReadString(SimpleTextSegmentInfoWriter.SI_VERSION.Length, scratch);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_DOCCOUNT));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_DOCCOUNT));
int docCount = Convert.ToInt32(ReadString(SimpleTextSegmentInfoWriter.SI_DOCCOUNT.Length, scratch), CultureInfo.InvariantCulture);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_USECOMPOUND));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_USECOMPOUND));
bool isCompoundFile = Convert.ToBoolean(ReadString(SimpleTextSegmentInfoWriter.SI_USECOMPOUND.Length, scratch), CultureInfo.InvariantCulture);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_NUM_DIAG));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_NUM_DIAG));
int numDiag = Convert.ToInt32(ReadString(SimpleTextSegmentInfoWriter.SI_NUM_DIAG.Length, scratch), CultureInfo.InvariantCulture);
IDictionary<string, string> diagnostics = new Dictionary<string, string>();
for (int i = 0; i < numDiag; i++)
{
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_DIAG_KEY));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_DIAG_KEY));
string key = ReadString(SimpleTextSegmentInfoWriter.SI_DIAG_KEY.Length, scratch);
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_DIAG_VALUE));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_DIAG_VALUE));
string value = ReadString(SimpleTextSegmentInfoWriter.SI_DIAG_VALUE.Length, scratch);
diagnostics[key] = value;
}
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_NUM_FILES));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_NUM_FILES));
int numFiles = Convert.ToInt32(ReadString(SimpleTextSegmentInfoWriter.SI_NUM_FILES.Length, scratch), CultureInfo.InvariantCulture);
var files = new JCG.HashSet<string>();
for (int i = 0; i < numFiles; i++)
{
SimpleTextUtil.ReadLine(input, scratch);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_FILE));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(scratch, SimpleTextSegmentInfoWriter.SI_FILE));
string fileName = ReadString(SimpleTextSegmentInfoWriter.SI_FILE.Length, scratch);
files.Add(fileName);
}
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs
index c17061f..d7afaa0 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs
@@ -113,26 +113,26 @@ namespace Lucene.Net.Codecs.SimpleText
}
}
SimpleTextUtil.CheckFooter(input);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto == _offsets.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto == _offsets.Length);
}
public override void VisitDocument(int n, StoredFieldVisitor visitor)
{
_input.Seek(_offsets[n]);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.NUM));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.NUM));
var numFields = ParseInt32At(SimpleTextStoredFieldsWriter.NUM.Length);
for (var i = 0; i < numFields; i++)
{
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.FIELD));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.FIELD));
int fieldNumber = ParseInt32At(SimpleTextStoredFieldsWriter.FIELD.Length);
FieldInfo fieldInfo = _fieldInfos.FieldInfo(fieldNumber);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.NAME));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.NAME));
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.TYPE));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.TYPE));
BytesRef type;
if (EqualsAt(SimpleTextStoredFieldsWriter.TYPE_STRING, _scratch, SimpleTextStoredFieldsWriter.TYPE.Length))
@@ -171,7 +171,7 @@ namespace Lucene.Net.Codecs.SimpleText
break;
case StoredFieldVisitor.Status.NO:
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.VALUE));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.VALUE));
break;
case StoredFieldVisitor.Status.STOP:
return;
@@ -182,7 +182,7 @@ namespace Lucene.Net.Codecs.SimpleText
private void ReadField(BytesRef type, FieldInfo fieldInfo, StoredFieldVisitor visitor)
{
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.VALUE));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextStoredFieldsWriter.VALUE));
if (Equals(type, SimpleTextStoredFieldsWriter.TYPE_STRING))
{
visitor.StringField(fieldInfo,
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
index 71f23ab..729d5b4 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
@@ -109,7 +109,7 @@ namespace Lucene.Net.Codecs.SimpleText
}
}
SimpleTextUtil.CheckFooter(input);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto == _offsets.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto == _offsets.Length);
}
public override Fields Get(int doc)
@@ -119,7 +119,7 @@ namespace Lucene.Net.Codecs.SimpleText
_input.Seek(_offsets[doc]);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.NUMFIELDS));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.NUMFIELDS));
var numFields = ParseInt32At(SimpleTextTermVectorsWriter.NUMFIELDS.Length);
if (numFields == 0)
{
@@ -128,28 +128,28 @@ namespace Lucene.Net.Codecs.SimpleText
for (var i = 0; i < numFields; i++)
{
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELD));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELD));
// skip fieldNumber:
ParseInt32At(SimpleTextTermVectorsWriter.FIELD.Length);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELDNAME));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELDNAME));
var fieldName = ReadString(SimpleTextTermVectorsWriter.FIELDNAME.Length, _scratch);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELDPOSITIONS));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELDPOSITIONS));
var positions = Convert.ToBoolean(ReadString(SimpleTextTermVectorsWriter.FIELDPOSITIONS.Length, _scratch), CultureInfo.InvariantCulture);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELDOFFSETS));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELDOFFSETS));
var offsets = Convert.ToBoolean(ReadString(SimpleTextTermVectorsWriter.FIELDOFFSETS.Length, _scratch), CultureInfo.InvariantCulture);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELDPAYLOADS));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELDPAYLOADS));
var payloads = Convert.ToBoolean(ReadString(SimpleTextTermVectorsWriter.FIELDPAYLOADS.Length, _scratch), CultureInfo.InvariantCulture);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELDTERMCOUNT));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.FIELDTERMCOUNT));
var termCount = ParseInt32At(SimpleTextTermVectorsWriter.FIELDTERMCOUNT.Length);
var terms = new SimpleTVTerms(offsets, positions, payloads);
@@ -158,7 +158,7 @@ namespace Lucene.Net.Codecs.SimpleText
for (var j = 0; j < termCount; j++)
{
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.TERMTEXT));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.TERMTEXT));
var term = new BytesRef();
var termLength = _scratch.Length - SimpleTextTermVectorsWriter.TERMTEXT.Length;
term.Grow(termLength);
@@ -169,7 +169,7 @@ namespace Lucene.Net.Codecs.SimpleText
terms.terms.Add(term, postings);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.TERMFREQ));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.TERMFREQ));
postings.freq = ParseInt32At(SimpleTextTermVectorsWriter.TERMFREQ.Length);
if (!positions && !offsets) continue;
@@ -194,12 +194,12 @@ namespace Lucene.Net.Codecs.SimpleText
if (positions)
{
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.POSITION));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.POSITION));
postings.positions[k] = ParseInt32At(SimpleTextTermVectorsWriter.POSITION.Length);
if (payloads)
{
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.PAYLOAD));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.PAYLOAD));
if (_scratch.Length - SimpleTextTermVectorsWriter.PAYLOAD.Length == 0)
{
postings.payloads[k] = null;
@@ -217,11 +217,11 @@ namespace Lucene.Net.Codecs.SimpleText
if (!offsets) continue;
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.STARTOFFSET));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.STARTOFFSET));
postings.startOffsets[k] = ParseInt32At(SimpleTextTermVectorsWriter.STARTOFFSET.Length);
ReadLine();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.ENDOFFSET));
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(_scratch, SimpleTextTermVectorsWriter.ENDOFFSET));
postings.endOffsets[k] = ParseInt32At(SimpleTextTermVectorsWriter.ENDOFFSET.Length);
}
}
@@ -444,7 +444,7 @@ namespace Lucene.Net.Codecs.SimpleText
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _freqRenamed != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_freqRenamed != -1);
return _freqRenamed;
}
}
@@ -495,7 +495,7 @@ namespace Lucene.Net.Codecs.SimpleText
if (_positions != null)
return _positions.Length;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _startOffsets != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_startOffsets != null);
return _startOffsets.Length;
}
}
@@ -540,7 +540,7 @@ namespace Lucene.Net.Codecs.SimpleText
public override int NextPosition()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (_positions != null && _nextPos < _positions.Length) ||
+ if (Debugging.AssertsEnabled) Debugging.Assert((_positions != null && _nextPos < _positions.Length) ||
_startOffsets != null && _nextPos < _startOffsets.Length);
if (_positions != null)
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsWriter.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsWriter.cs
index b2dd7ef..e178c3e 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsWriter.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsWriter.cs
@@ -143,7 +143,7 @@ namespace Lucene.Net.Codecs.SimpleText
public override void AddPosition(int position, int startOffset, int endOffset, BytesRef payload)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _positions || _offsets);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_positions || _offsets);
if (_positions)
{
@@ -156,7 +156,7 @@ namespace Lucene.Net.Codecs.SimpleText
Write(PAYLOAD);
if (payload != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => payload.Length > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(payload.Length > 0);
Write(payload);
}
NewLine();
diff --git a/src/Lucene.Net.Expressions/ExpressionComparator.cs b/src/Lucene.Net.Expressions/ExpressionComparator.cs
index 4905386..0340201 100644
--- a/src/Lucene.Net.Expressions/ExpressionComparator.cs
+++ b/src/Lucene.Net.Expressions/ExpressionComparator.cs
@@ -49,11 +49,11 @@ namespace Lucene.Net.Expressions
base.SetScorer(scorer);
// TODO: might be cleaner to lazy-init 'source' and set scorer after?
- if (Debugging.AssertsEnabled) Debugging.Assert(() => readerContext != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(readerContext != null);
try
{
var context = new Dictionary<string, object>();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => scorer != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(scorer != null);
context["scorer"] = scorer;
scores = source.GetValues(context, readerContext);
}
diff --git a/src/Lucene.Net.Expressions/ScoreFunctionValues.cs b/src/Lucene.Net.Expressions/ScoreFunctionValues.cs
index a42d4ec..a28bc3f 100644
--- a/src/Lucene.Net.Expressions/ScoreFunctionValues.cs
+++ b/src/Lucene.Net.Expressions/ScoreFunctionValues.cs
@@ -43,7 +43,7 @@ namespace Lucene.Net.Expressions
{
try
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => document == scorer.DocID);
+ if (Debugging.AssertsEnabled) Debugging.Assert(document == scorer.DocID);
return scorer.GetScore();
}
catch (IOException exception)
diff --git a/src/Lucene.Net.Facet/DrillDownQuery.cs b/src/Lucene.Net.Facet/DrillDownQuery.cs
index 7d26a0e..40c050d 100644
--- a/src/Lucene.Net.Facet/DrillDownQuery.cs
+++ b/src/Lucene.Net.Facet/DrillDownQuery.cs
@@ -86,7 +86,7 @@ namespace Lucene.Net.Facet
{
throw new ArgumentException("cannot apply filter unless baseQuery isn't null; pass ConstantScoreQuery instead");
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => clauses.Length == 1 + other.drillDownDims.Count, () => clauses.Length + " vs " + (1 + other.drillDownDims.Count));
+ if (Debugging.AssertsEnabled) Debugging.Assert(clauses.Length == 1 + other.drillDownDims.Count, () => clauses.Length + " vs " + (1 + other.drillDownDims.Count));
drillDownDims.PutAll(other.drillDownDims);
query.Add(new FilteredQuery(clauses[0].Query, filter), Occur.MUST);
for (int i = 1; i < clauses.Length; i++)
diff --git a/src/Lucene.Net.Facet/DrillSideways.cs b/src/Lucene.Net.Facet/DrillSideways.cs
index b144bb2..80d0509 100644
--- a/src/Lucene.Net.Facet/DrillSideways.cs
+++ b/src/Lucene.Net.Facet/DrillSideways.cs
@@ -175,7 +175,7 @@ namespace Lucene.Net.Facet
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => clauses.Length == 1 + drillDownDims.Count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(clauses.Length == 1 + drillDownDims.Count);
baseQuery = clauses[0].Query;
startClause = 1;
}
diff --git a/src/Lucene.Net.Facet/DrillSidewaysScorer.cs b/src/Lucene.Net.Facet/DrillSidewaysScorer.cs
index ccbc0c2..afd9bc1 100644
--- a/src/Lucene.Net.Facet/DrillSidewaysScorer.cs
+++ b/src/Lucene.Net.Facet/DrillSidewaysScorer.cs
@@ -89,7 +89,7 @@ namespace Lucene.Net.Facet
// TODO: if we ever allow null baseScorer ... it will
// mean we DO score docs out of order ... hmm, or if we
// change up the order of the conjuntions below
- if (Debugging.AssertsEnabled) Debugging.Assert(() => baseScorer != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(baseScorer != null);
// some scorers, eg ReqExlScorer, can hit NPE if cost is called after nextDoc
long baseQueryCost = baseScorer.GetCost();
@@ -395,7 +395,7 @@ namespace Lucene.Net.Facet
while (slot0 < CHUNK && (slot0 = seen.NextSetBit(slot0)) != -1)
{
int ddDocID = docIDs[slot0];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ddDocID != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ddDocID != -1);
int baseDocID = baseScorer.DocID;
if (baseDocID < ddDocID)
@@ -550,7 +550,7 @@ namespace Lucene.Net.Facet
//}
// Mark slot as valid:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docIDs[slot] != docID, () => "slot=" + slot + " docID=" + docID);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docIDs[slot] != docID, () => "slot=" + slot + " docID=" + docID);
docIDs[slot] = docID;
scores[slot] = baseScorer.GetScore();
filledSlots[filledCount++] = slot;
diff --git a/src/Lucene.Net.Facet/FacetsConfig.cs b/src/Lucene.Net.Facet/FacetsConfig.cs
index b0f0f0e..5183065 100644
--- a/src/Lucene.Net.Facet/FacetsConfig.cs
+++ b/src/Lucene.Net.Facet/FacetsConfig.cs
@@ -694,7 +694,7 @@ namespace Lucene.Net.Facet
}
}
parts.Add(new string(buffer, 0, upto));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !lastEscape);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!lastEscape);
return parts.ToArray();
}
}
diff --git a/src/Lucene.Net.Facet/Range/LongRangeCounter.cs b/src/Lucene.Net.Facet/Range/LongRangeCounter.cs
index 0641fc6..c8b8998 100644
--- a/src/Lucene.Net.Facet/Range/LongRangeCounter.cs
+++ b/src/Lucene.Net.Facet/Range/LongRangeCounter.cs
@@ -120,7 +120,7 @@ namespace Lucene.Net.Facet.Range
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => flags == 2);
+ if (Debugging.AssertsEnabled) Debugging.Assert(flags == 2);
// This point is only the end of an interval; attach
// it to last interval:
elementaryIntervals.Add(new InclusiveRange(prev, v));
@@ -275,7 +275,7 @@ namespace Lucene.Net.Facet.Range
public InclusiveRange(long start, long end)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => end >= start);
+ if (Debugging.AssertsEnabled) Debugging.Assert(end >= start);
this.Start = start;
this.End = end;
}
@@ -349,7 +349,7 @@ namespace Lucene.Net.Facet.Range
}
else if (left != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => right != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(right != null);
// Recurse:
left.AddOutputs(index, range);
right.AddOutputs(index, range);
@@ -361,7 +361,7 @@ namespace Lucene.Net.Facet.Range
Indent(sb, depth);
if (left == null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => right == null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(right == null);
sb.Append("leaf: " + start + " to " + end);
}
else
@@ -377,7 +377,7 @@ namespace Lucene.Net.Facet.Range
if (left != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => right != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(right != null);
left.ToString(sb, depth + 1);
right.ToString(sb, depth + 1);
}
diff --git a/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs b/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs
index 92f5d57..7f3f6b2 100644
--- a/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs
@@ -65,7 +65,7 @@ namespace Lucene.Net.Facet.Taxonomy
// while the code which calls this method is safe, at some point a test
// tripped on AIOOBE in toString, but we failed to reproduce. adding the
// assert as a safety check.
- if (Debugging.AssertsEnabled) Debugging.Assert(() => prefixLen > 0 && prefixLen <= copyFrom.Components.Length, () => "prefixLen cannot be negative nor larger than the given components' length: prefixLen=" + prefixLen + " components.length=" + copyFrom.Components.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(prefixLen > 0 && prefixLen <= copyFrom.Components.Length, () => "prefixLen cannot be negative nor larger than the given components' length: prefixLen=" + prefixLen + " components.length=" + copyFrom.Components.Length);
this.Components = copyFrom.Components;
Length = prefixLen;
}
@@ -75,7 +75,7 @@ namespace Lucene.Net.Facet.Taxonomy
/// </summary>
public CategoryPath(params string[] components)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => components.Length > 0, () => "use CategoryPath.EMPTY to create an empty path");
+ if (Debugging.AssertsEnabled) Debugging.Assert(components.Length > 0, () => "use CategoryPath.EMPTY to create an empty path");
foreach (string comp in components)
{
if (string.IsNullOrEmpty(comp))
diff --git a/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs b/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
index 52df74c..79da91f 100644
--- a/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
@@ -190,7 +190,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
// verify (to some extent) that merge policy in effect would preserve category docids
if (indexWriter != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !(indexWriter.Config.MergePolicy is TieredMergePolicy), () => "for preserving category docids, merging none-adjacent segments is not allowed");
+ if (Debugging.AssertsEnabled) Debugging.Assert(!(indexWriter.Config.MergePolicy is TieredMergePolicy), () => "for preserving category docids, merging none-adjacent segments is not allowed");
}
// after we opened the writer, and the index is locked, it's safe to check
@@ -826,7 +826,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
FacetLabel cp = new FacetLabel(FacetsConfig.StringToPath(t.Utf8ToString()));
docsEnum = termsEnum.Docs(null, docsEnum, DocsFlags.NONE);
bool res = cache.Put(cp, docsEnum.NextDoc() + ctx.DocBase);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !res, () => "entries should not have been evicted from the cache");
+ if (Debugging.AssertsEnabled) Debugging.Assert(!res, () => "entries should not have been evicted from the cache");
}
else
{
@@ -907,7 +907,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
}
int[] parents = GetTaxoArrays().Parents;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ordinal < parents.Length, () => "requested ordinal (" + ordinal + "); parents.length (" + parents.Length + ") !");
+ if (Debugging.AssertsEnabled) Debugging.Assert(ordinal < parents.Length, () => "requested ordinal (" + ordinal + "); parents.length (" + parents.Length + ") !");
return parents[ordinal];
}
diff --git a/src/Lucene.Net.Facet/Taxonomy/Directory/TaxonomyIndexArrays.cs b/src/Lucene.Net.Facet/Taxonomy/Directory/TaxonomyIndexArrays.cs
index 52e71c9..dd5030e 100644
--- a/src/Lucene.Net.Facet/Taxonomy/Directory/TaxonomyIndexArrays.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/Directory/TaxonomyIndexArrays.cs
@@ -77,7 +77,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
public TaxonomyIndexArrays(IndexReader reader, TaxonomyIndexArrays copyFrom)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => copyFrom != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(copyFrom != null);
// note that copyParents.length may be equal to reader.maxDoc(). this is not a bug
// it may be caused if e.g. the taxonomy segments were merged, and so an updated
diff --git a/src/Lucene.Net.Facet/Taxonomy/FacetLabel.cs b/src/Lucene.Net.Facet/Taxonomy/FacetLabel.cs
index c9bc017..562d80e 100644
--- a/src/Lucene.Net.Facet/Taxonomy/FacetLabel.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/FacetLabel.cs
@@ -68,7 +68,7 @@ namespace Lucene.Net.Facet.Taxonomy
// while the code which calls this method is safe, at some point a test
// tripped on AIOOBE in toString, but we failed to reproduce. adding the
// assert as a safety check.
- if (Debugging.AssertsEnabled) Debugging.Assert(() => prefixLen >= 0 && prefixLen <= copyFrom.Components.Length, () => "prefixLen cannot be negative nor larger than the given components' length: prefixLen=" + prefixLen + " components.length=" + copyFrom.Components.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(prefixLen >= 0 && prefixLen <= copyFrom.Components.Length, () => "prefixLen cannot be negative nor larger than the given components' length: prefixLen=" + prefixLen + " components.length=" + copyFrom.Components.Length);
this.Components = copyFrom.Components;
Length = prefixLen;
}
diff --git a/src/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs b/src/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
index b71ed1f..15e8233 100644
--- a/src/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
@@ -58,7 +58,7 @@ namespace Lucene.Net.Facet.Taxonomy
if (ft.IsHierarchical && ft.IsMultiValued == false)
{
int dimRootOrd = m_taxoReader.GetOrdinal(new FacetLabel(dim));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => dimRootOrd > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(dimRootOrd > 0);
m_values[dimRootOrd] += Rollup(m_children[dimRootOrd]);
}
}
diff --git a/src/Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs b/src/Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs
index fa4cec5..d3aee8f 100644
--- a/src/Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs
@@ -143,7 +143,7 @@ namespace Lucene.Net.Facet.Taxonomy
public static T OpenIfChanged<T>(T oldTaxoReader) where T : TaxonomyReader
{
T newTaxoReader = (T)oldTaxoReader.DoOpenIfChanged();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => newTaxoReader != oldTaxoReader);
+ if (Debugging.AssertsEnabled) Debugging.Assert(newTaxoReader != oldTaxoReader);
return newTaxoReader;
}
diff --git a/src/Lucene.Net.Grouping/AbstractFirstPassGroupingCollector.cs b/src/Lucene.Net.Grouping/AbstractFirstPassGroupingCollector.cs
index 2e39fef..a7bd395 100644
--- a/src/Lucene.Net.Grouping/AbstractFirstPassGroupingCollector.cs
+++ b/src/Lucene.Net.Grouping/AbstractFirstPassGroupingCollector.cs
@@ -248,7 +248,7 @@ namespace Lucene.Net.Search.Grouping
bottomGroup = m_orderedGroups.Last();
m_orderedGroups.Remove(bottomGroup);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_orderedGroups.Count == topNGroups - 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_orderedGroups.Count == topNGroups - 1);
groupMap.Remove(bottomGroup.GroupValue);
@@ -263,7 +263,7 @@ namespace Lucene.Net.Search.Grouping
groupMap[bottomGroup.GroupValue] = bottomGroup;
m_orderedGroups.Add(bottomGroup);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_orderedGroups.Count == topNGroups);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_orderedGroups.Count == topNGroups);
int lastComparerSlot = m_orderedGroups.Last().ComparerSlot;
foreach (FieldComparer fc in comparers)
@@ -315,7 +315,7 @@ namespace Lucene.Net.Search.Grouping
prevLast = m_orderedGroups.Last();
m_orderedGroups.Remove(group);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_orderedGroups.Count == topNGroups - 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_orderedGroups.Count == topNGroups - 1);
}
else
{
@@ -333,7 +333,7 @@ namespace Lucene.Net.Search.Grouping
if (m_orderedGroups != null)
{
m_orderedGroups.Add(group);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_orderedGroups.Count == topNGroups);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_orderedGroups.Count == topNGroups);
var newLast = m_orderedGroups.Last();
// If we changed the value of the last group, or changed which group was last, then update bottom:
if (group == newLast || prevLast != newLast)
@@ -376,7 +376,7 @@ namespace Lucene.Net.Search.Grouping
var comparer = new BuildSortedSetComparer(this);
m_orderedGroups = new JCG.SortedSet<CollectedSearchGroup<TGroupValue>>(comparer);
m_orderedGroups.UnionWith(groupMap.Values);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_orderedGroups.Count > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_orderedGroups.Count > 0);
foreach (FieldComparer fc in comparers)
{
diff --git a/src/Lucene.Net.Grouping/BlockGroupingCollector.cs b/src/Lucene.Net.Grouping/BlockGroupingCollector.cs
index 2934754..3d73f2d 100644
--- a/src/Lucene.Net.Grouping/BlockGroupingCollector.cs
+++ b/src/Lucene.Net.Grouping/BlockGroupingCollector.cs
@@ -155,8 +155,8 @@ namespace Lucene.Net.Search.Grouping
//System.out.println(" ltcheck");
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => group1 != group2);
- Debugging.Assert(() => group1.comparerSlot != group2.comparerSlot);
+ Debugging.Assert(group1 != group2);
+ Debugging.Assert(group1.comparerSlot != group2.comparerSlot);
}
int numComparers = outerInstance.comparers.Length;
@@ -224,7 +224,7 @@ namespace Lucene.Net.Search.Grouping
{
// Replace bottom element in PQ and then updateTop
OneGroup og = groupQueue.Top;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => og != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(og != null);
og.count = subDocUpto;
og.topGroupDoc = docBase + topGroupDoc;
// Swap pending docs
@@ -524,7 +524,7 @@ namespace Lucene.Net.Search.Grouping
{
if (subDocUpto == 1)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !queueFull);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!queueFull);
//System.out.println(" init copy to bottomSlot=" + bottomSlot);
foreach (FieldComparer fc in comparers)
diff --git a/src/Lucene.Net.Grouping/SearchGroup.cs b/src/Lucene.Net.Grouping/SearchGroup.cs
index 32f4756..680b257 100644
--- a/src/Lucene.Net.Grouping/SearchGroup.cs
+++ b/src/Lucene.Net.Grouping/SearchGroup.cs
@@ -186,12 +186,12 @@ namespace Lucene.Net.Search.Grouping
{
if (groupValue == null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => otherMergedGroup.groupValue != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(otherMergedGroup.groupValue != null);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !groupValueIsValueType
+ if (Debugging.AssertsEnabled) Debugging.Assert(!groupValueIsValueType
? JCG.EqualityComparer<T>.Default.Equals(groupValue, otherMergedGroup.groupValue)
// LUCENENET specific - use J2N.Collections.StructuralEqualityComparer.Default.Equals() if we have a reference type
@@ -206,7 +206,7 @@ namespace Lucene.Net.Search.Grouping
{
// We never have another MergedGroup instance with
// same groupValue
- if (Debugging.AssertsEnabled) Debugging.Assert(() => NeverEquals(other));
+ if (Debugging.AssertsEnabled) Debugging.Assert(NeverEquals(other));
if (other is MergedGroup<T> otherMergedGroup)
{
@@ -294,7 +294,7 @@ namespace Lucene.Net.Search.Grouping
}
// Tie break by min shard index:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => group.MinShardIndex != other.MinShardIndex);
+ if (Debugging.AssertsEnabled) Debugging.Assert(group.MinShardIndex != other.MinShardIndex);
return group.MinShardIndex - other.MinShardIndex;
}
}
@@ -327,7 +327,7 @@ namespace Lucene.Net.Search.Grouping
//System.out.println(" new");
mergedGroup = new MergedGroup<T>(group.GroupValue);
mergedGroup.MinShardIndex = shard.ShardIndex;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => group.SortValues != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(group.SortValues != null);
mergedGroup.TopValues = group.SortValues;
groupsSeen[group.GroupValue] = mergedGroup;
mergedGroup.IsInQueue = true;
diff --git a/src/Lucene.Net.Grouping/Term/TermGroupFacetCollector.cs b/src/Lucene.Net.Grouping/Term/TermGroupFacetCollector.cs
index 2d65424..45ddcbc 100644
--- a/src/Lucene.Net.Grouping/Term/TermGroupFacetCollector.cs
+++ b/src/Lucene.Net.Grouping/Term/TermGroupFacetCollector.cs
@@ -175,7 +175,7 @@ namespace Lucene.Net.Search.Grouping.Terms
BytesRef facetEndPrefix = BytesRef.DeepCopyOf(m_facetPrefix);
facetEndPrefix.Append(UnicodeUtil.BIG_TERM);
m_endFacetOrd = facetFieldTermsIndex.LookupTerm(facetEndPrefix);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_endFacetOrd < 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_endFacetOrd < 0);
m_endFacetOrd = -m_endFacetOrd - 1; // Points to the ord one higher than facetEndPrefix
}
else
@@ -203,7 +203,7 @@ namespace Lucene.Net.Search.Grouping.Terms
this.m_mergePos = startFacetOrd == -1 ? 1 : startFacetOrd + 1;
if (m_mergePos < m_maxTermPos)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => tenum != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(tenum != null);
tenum.SeekExact(startFacetOrd == -1 ? 0 : startFacetOrd);
m_mergeTerm = tenum.Term;
}
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
index ffc4b8e..a26ba1e 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
@@ -292,7 +292,7 @@ namespace Lucene.Net.Search.PostingsHighlight
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentStartOffset >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentStartOffset >= 0);
return currentStartOffset;
}
}
@@ -301,7 +301,7 @@ namespace Lucene.Net.Search.PostingsHighlight
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentEndOffset >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentEndOffset >= 0);
return currentEndOffset;
}
}
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/Passage.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/Passage.cs
index 22805b2..fa0f236 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/Passage.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/Passage.cs
@@ -43,7 +43,7 @@ namespace Lucene.Net.Search.PostingsHighlight
internal void AddMatch(int startOffset, int endOffset, BytesRef term)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => startOffset >= this.startOffset && startOffset <= this.endOffset);
+ if (Debugging.AssertsEnabled) Debugging.Assert(startOffset >= this.startOffset && startOffset <= this.endOffset);
if (numMatches == matchStarts.Length)
{
int newLength = ArrayUtil.Oversize(numMatches + 1, RamUsageEstimator.NUM_BYTES_OBJECT_REF);
@@ -57,7 +57,7 @@ namespace Lucene.Net.Search.PostingsHighlight
matchEnds = newMatchEnds;
matchTerms = newMatchTerms;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => matchStarts.Length == matchEnds.Length && matchEnds.Length == matchTerms.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(matchStarts.Length == matchEnds.Length && matchEnds.Length == matchTerms.Length);
matchStarts[numMatches] = startOffset;
matchEnds[numMatches] = endOffset;
matchTerms[numMatches] = term;
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/PostingsHighlighter.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/PostingsHighlighter.cs
index b5b5a8a..09786eb 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/PostingsHighlighter.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/PostingsHighlighter.cs
@@ -542,7 +542,7 @@ namespace Lucene.Net.Search.PostingsHighlight
AtomicReaderContext subContext = leaves[leaf];
AtomicReader r = subContext.AtomicReader;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => leaf >= lastLeaf); // increasing order
+ if (Debugging.AssertsEnabled) Debugging.Assert(leaf >= lastLeaf); // increasing order
// if the segment has changed, we must initialize new enums.
if (leaf != lastLeaf)
@@ -671,7 +671,7 @@ namespace Lucene.Net.Search.PostingsHighlight
// LUCENE-5166: this hit would span the content limit... however more valid
// hits may exist (they are sorted by start). so we pretend like we never
// saw this term, it won't cause a passage to be added to passageQueue or anything.
- if (Debugging.AssertsEnabled) Debugging.Assert(() => EMPTY.StartOffset == int.MaxValue);
+ if (Debugging.AssertsEnabled) Debugging.Assert(EMPTY.StartOffset == int.MaxValue);
if (start < contentLength && end > contentLength)
{
continue;
@@ -714,7 +714,7 @@ namespace Lucene.Net.Search.PostingsHighlight
return passages;
}
// advance breakiterator
- if (Debugging.AssertsEnabled) Debugging.Assert(() => BreakIterator.Done < 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(BreakIterator.Done < 0);
current.startOffset = Math.Max(bi.Preceding(start + 1), 0);
current.endOffset = Math.Min(bi.Next(), contentLength);
}
@@ -727,7 +727,7 @@ namespace Lucene.Net.Search.PostingsHighlight
{
// multitermquery match, pull from payload
term = off.dp.GetPayload();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => term != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(term != null);
}
current.AddMatch(start, end, term);
if (off.pos == dp.Freq)
@@ -751,7 +751,7 @@ namespace Lucene.Net.Search.PostingsHighlight
}
// Dead code but compiler disagrees:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false);
return null;
}
@@ -766,7 +766,7 @@ namespace Lucene.Net.Search.PostingsHighlight
// BreakIterator should be un-next'd:
List<Passage> passages = new List<Passage>();
int pos = bi.Current;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pos == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pos == 0);
while (passages.Count < maxPassages)
{
int next = bi.Next();
@@ -883,7 +883,7 @@ namespace Lucene.Net.Search.PostingsHighlight
public LimitedStoredFieldVisitor(string[] fields, char[] valueSeparators, int maxLength)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fields.Length == valueSeparators.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fields.Length == valueSeparators.Length);
this.fields = fields;
this.valueSeparators = valueSeparators;
this.maxLength = maxLength;
@@ -896,7 +896,7 @@ namespace Lucene.Net.Search.PostingsHighlight
public override void StringField(Index.FieldInfo fieldInfo, string value)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentField >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentField >= 0);
StringBuilder builder = builders[currentField];
if (builder.Length > 0 && builder.Length < maxLength)
{
diff --git a/src/Lucene.Net.Highlighter/VectorHighlight/BaseFragListBuilder.cs b/src/Lucene.Net.Highlighter/VectorHighlight/BaseFragListBuilder.cs
index 7f656b8..1c328c2 100644
--- a/src/Lucene.Net.Highlighter/VectorHighlight/BaseFragListBuilder.cs
+++ b/src/Lucene.Net.Highlighter/VectorHighlight/BaseFragListBuilder.cs
@@ -142,7 +142,7 @@ namespace Lucene.Net.Search.VectorHighlight
{
this.iter = iter;
T removeTop = RemoveTop();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => removeTop == null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(removeTop == null);
}
public T Top()
diff --git a/src/Lucene.Net.Highlighter/VectorHighlight/FieldTermStack.cs b/src/Lucene.Net.Highlighter/VectorHighlight/FieldTermStack.cs
index 9818598..fda9446 100644
--- a/src/Lucene.Net.Highlighter/VectorHighlight/FieldTermStack.cs
+++ b/src/Lucene.Net.Highlighter/VectorHighlight/FieldTermStack.cs
@@ -140,7 +140,7 @@ namespace Lucene.Net.Search.VectorHighlight
TermInfo current = termList[i];
if (current.Position == currentPos)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => previous != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(previous != null);
previous.SetNext(current);
previous = current;
//iterator.Remove();
diff --git a/src/Lucene.Net.Join/ToChildBlockJoinQuery.cs b/src/Lucene.Net.Join/ToChildBlockJoinQuery.cs
index 09d424a..f3e0297 100644
--- a/src/Lucene.Net.Join/ToChildBlockJoinQuery.cs
+++ b/src/Lucene.Net.Join/ToChildBlockJoinQuery.cs
@@ -246,7 +246,7 @@ namespace Lucene.Net.Join
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _childDoc < _parentDoc, () => "childDoc=" + _childDoc + " parentDoc=" + _parentDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_childDoc < _parentDoc, () => "childDoc=" + _childDoc + " parentDoc=" + _parentDoc);
_childDoc++;
if (_acceptDocs != null && !_acceptDocs.Get(_childDoc))
{
@@ -280,7 +280,7 @@ namespace Lucene.Net.Join
public override int Advance(int childTarget)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => childTarget >= _parentBits.Length || !_parentBits.Get(childTarget));
+ if (Debugging.AssertsEnabled) Debugging.Assert(childTarget >= _parentBits.Length || !_parentBits.Get(childTarget));
//System.out.println("Q.advance childTarget=" + childTarget);
if (childTarget == NO_MORE_DOCS)
@@ -289,14 +289,14 @@ namespace Lucene.Net.Join
return _childDoc = _parentDoc = NO_MORE_DOCS;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _childDoc == -1 || childTarget != _parentDoc, () => "childTarget=" + childTarget);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_childDoc == -1 || childTarget != _parentDoc, () => "childTarget=" + childTarget);
if (_childDoc == -1 || childTarget > _parentDoc)
{
// Advance to new parent:
_parentDoc = _parentScorer.Advance(childTarget);
ValidateParentDoc();
//System.out.println(" advance to parentDoc=" + parentDoc);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _parentDoc > childTarget);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_parentDoc > childTarget);
if (_parentDoc == NO_MORE_DOCS)
{
//System.out.println(" END");
@@ -312,7 +312,7 @@ namespace Lucene.Net.Join
childTarget = Math.Max(childTarget, firstChild);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => childTarget < _parentDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(childTarget < _parentDoc);
// Advance within children of current parent:
_childDoc = childTarget;
diff --git a/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs b/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs
index 71deac5..61550ca 100644
--- a/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs
+++ b/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs
@@ -284,7 +284,7 @@ namespace Lucene.Net.Join
og.counts[scorerIDX] = joinScorer.ChildCount;
//System.out.println(" count=" + og.counts[scorerIDX]);
og.docs[scorerIDX] = joinScorer.SwapChildDocs(og.docs[scorerIDX]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => og.docs[scorerIDX].Length >= og.counts[scorerIDX], () => "length=" + og.docs[scorerIDX].Length + " vs count=" + og.counts[scorerIDX]);
+ if (Debugging.AssertsEnabled) Debugging.Assert(og.docs[scorerIDX].Length >= og.counts[scorerIDX], () => "length=" + og.docs[scorerIDX].Length + " vs count=" + og.counts[scorerIDX]);
//System.out.println(" len=" + og.docs[scorerIDX].length);
/*
for(int idx=0;idx<og.counts[scorerIDX];idx++) {
@@ -295,7 +295,7 @@ namespace Lucene.Net.Join
{
//System.out.println(" copy scores");
og.scores[scorerIDX] = joinScorer.SwapChildScores(og.scores[scorerIDX]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => og.scores[scorerIDX].Length >= og.counts[scorerIDX], () => "length=" + og.scores[scorerIDX].Length + " vs count=" + og.counts[scorerIDX]);
+ if (Debugging.AssertsEnabled) Debugging.Assert(og.scores[scorerIDX].Length >= og.counts[scorerIDX], () => "length=" + og.scores[scorerIDX].Length + " vs count=" + og.counts[scorerIDX]);
}
}
else
diff --git a/src/Lucene.Net.Join/ToParentBlockJoinQuery.cs b/src/Lucene.Net.Join/ToParentBlockJoinQuery.cs
index 84f41fd..ae816ec 100644
--- a/src/Lucene.Net.Join/ToParentBlockJoinQuery.cs
+++ b/src/Lucene.Net.Join/ToParentBlockJoinQuery.cs
@@ -284,7 +284,7 @@ namespace Lucene.Net.Join
}
//System.out.println(" parentDoc=" + parentDoc);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _parentDoc != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_parentDoc != -1);
//System.out.println(" nextChildDoc=" + nextChildDoc);
if (_acceptDocs != null && !_acceptDocs.Get(_parentDoc))
@@ -402,7 +402,7 @@ namespace Lucene.Net.Join
_prevParentDoc = _parentBits.PrevSetBit(parentTarget - 1);
//System.out.println(" rolled back to prevParentDoc=" + prevParentDoc + " vs parentDoc=" + parentDoc);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => _prevParentDoc >= _parentDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(_prevParentDoc >= _parentDoc);
if (_prevParentDoc > _nextChildDoc)
{
_nextChildDoc = _childScorer.Advance(_prevParentDoc);
diff --git a/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs b/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs
index c6ef1a5..6f6d3fc 100644
--- a/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs
+++ b/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs
@@ -250,7 +250,7 @@ namespace Lucene.Net.Index.Memory
return mid;
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => comparer.Compare(bytesRef, b) != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(comparer.Compare(bytesRef, b) != 0);
return -(low + 1);
}
@@ -285,7 +285,7 @@ namespace Lucene.Net.Index.Memory
public override void SeekExact(long ord)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord < info.terms.Count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord < info.terms.Count);
termUpto = (int)ord;
}
@@ -332,7 +332,7 @@ namespace Lucene.Net.Index.Memory
public override void SeekExact(BytesRef term, TermState state)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != null);
this.SeekExact(((OrdTermState)state).Ord);
}
@@ -452,8 +452,8 @@ namespace Lucene.Net.Index.Memory
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => posUpto++ < freq);
- Debugging.Assert(() => !sliceReader.IsEndOfSlice, () => " stores offsets : " + startOffset);
+ Debugging.Assert(posUpto++ < freq);
+ Debugging.Assert(!sliceReader.IsEndOfSlice, () => " stores offsets : " + startOffset);
}
if (outerInstance.outerInstance.storeOffsets)
{
diff --git a/src/Lucene.Net.Memory/MemoryIndex.cs b/src/Lucene.Net.Memory/MemoryIndex.cs
index 18df8c9..19ea43e 100644
--- a/src/Lucene.Net.Memory/MemoryIndex.cs
+++ b/src/Lucene.Net.Memory/MemoryIndex.cs
@@ -217,7 +217,7 @@ namespace Lucene.Net.Index.Memory
this.bytesUsed = Counter.NewCounter();
int maxBufferedByteBlocks = (int)((maxReusedBytes / 2) / ByteBlockPool.BYTE_BLOCK_SIZE);
int maxBufferedIntBlocks = (int)((maxReusedBytes - (maxBufferedByteBlocks * ByteBlockPool.BYTE_BLOCK_SIZE)) / (Int32BlockPool.INT32_BLOCK_SIZE * RamUsageEstimator.NUM_BYTES_INT32));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (maxBufferedByteBlocks * ByteBlockPool.BYTE_BLOCK_SIZE) + (maxBufferedIntBlocks * Int32BlockPool.INT32_BLOCK_SIZE * RamUsageEstimator.NUM_BYTES_INT32) <= maxReusedBytes);
+ if (Debugging.AssertsEnabled) Debugging.Assert((maxBufferedByteBlocks * ByteBlockPool.BYTE_BLOCK_SIZE) + (maxBufferedIntBlocks * Int32BlockPool.INT32_BLOCK_SIZE * RamUsageEstimator.NUM_BYTES_INT32) <= maxReusedBytes);
byteBlockPool = new ByteBlockPool(new RecyclingByteBlockAllocator(ByteBlockPool.BYTE_BLOCK_SIZE, maxBufferedByteBlocks, bytesUsed));
intBlockPool = new Int32BlockPool(new RecyclingInt32BlockAllocator(Int32BlockPool.INT32_BLOCK_SIZE, maxBufferedIntBlocks, bytesUsed));
postingsWriter = new Int32BlockPool.SliceWriter(intBlockPool);
@@ -741,9 +741,9 @@ namespace Lucene.Net.Index.Memory
freq = new int[ArrayUtil.Oversize(ord.Length, RamUsageEstimator.NUM_BYTES_INT32)];
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => start.Length >= ord.Length);
- Debugging.Assert(() => end.Length >= ord.Length);
- Debugging.Assert(() => freq.Length >= ord.Length);
+ Debugging.Assert(start.Length >= ord.Length);
+ Debugging.Assert(end.Length >= ord.Length);
+ Debugging.Assert(freq.Length >= ord.Length);
}
return ord;
}
@@ -759,9 +759,9 @@ namespace Lucene.Net.Index.Memory
}
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => start.Length >= ord.Length);
- Debugging.Assert(() => end.Length >= ord.Length);
- Debugging.Assert(() => freq.Length >= ord.Length);
+ Debugging.Assert(start.Length >= ord.Length);
+ Debugging.Assert(end.Length >= ord.Length);
+ Debugging.Assert(freq.Length >= ord.Length);
}
return ord;
}
diff --git a/src/Lucene.Net.Misc/Document/LazyDocument.cs b/src/Lucene.Net.Misc/Document/LazyDocument.cs
index bc2aa77..3e6e751 100644
--- a/src/Lucene.Net.Misc/Document/LazyDocument.cs
+++ b/src/Lucene.Net.Misc/Document/LazyDocument.cs
@@ -120,7 +120,7 @@ namespace Lucene.Net.Documents
fields.TryGetValue(fieldNum, out lazyValues);
IIndexableField[] realValues = d.GetFields(name);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => realValues.Length <= lazyValues.Count,
+ if (Debugging.AssertsEnabled) Debugging.Assert(realValues.Length <= lazyValues.Count,
() => "More lazy values then real values for field: " + name);
for (int i = 0; i < lazyValues.Count; i++)
@@ -166,8 +166,8 @@ namespace Lucene.Net.Documents
}
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => HasBeenLoaded, () => "field value was not lazy loaded");
- Debugging.Assert(() => realValue.Name.Equals(Name, StringComparison.Ordinal), () => "realvalue name != name: " + realValue.Name + " != " + Name);
+ Debugging.Assert(HasBeenLoaded, () => "field value was not lazy loaded");
+ Debugging.Assert(realValue.Name.Equals(Name, StringComparison.Ordinal), () => "realvalue name != name: " + realValue.Name + " != " + Name);
}
return realValue;
diff --git a/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs b/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs
index 17695f7..29c6f00 100644
--- a/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs
+++ b/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs
@@ -297,7 +297,7 @@ namespace Lucene.Net.Index
if (m_input.HasDeletions)
{
IBits oldLiveDocs = m_input.LiveDocs;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => oldLiveDocs != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(oldLiveDocs != null);
// this loop is a little bit ineffective, as Bits has no nextSetBit():
for (int i = 0; i < maxDoc; i++)
{
diff --git a/src/Lucene.Net.Misc/Index/PKIndexSplitter.cs b/src/Lucene.Net.Misc/Index/PKIndexSplitter.cs
index 8f96af9..b90a713 100644
--- a/src/Lucene.Net.Misc/Index/PKIndexSplitter.cs
+++ b/src/Lucene.Net.Misc/Index/PKIndexSplitter.cs
@@ -156,7 +156,7 @@ namespace Lucene.Net.Index
if (m_input.HasDeletions)
{
IBits oldLiveDocs = m_input.LiveDocs;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => oldLiveDocs != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(oldLiveDocs != null);
DocIdSetIterator it = bits.GetIterator();
for (int i = it.NextDoc(); i < maxDoc; i = it.NextDoc())
{
diff --git a/src/Lucene.Net.Misc/Index/Sorter/Sorter.cs b/src/Lucene.Net.Misc/Index/Sorter/Sorter.cs
index cfff119..4aacfc4 100644
--- a/src/Lucene.Net.Misc/Index/Sorter/Sorter.cs
+++ b/src/Lucene.Net.Misc/Index/Sorter/Sorter.cs
@@ -85,8 +85,8 @@ namespace Lucene.Net.Index.Sorter
int oldID = docMap.NewToOld(newID);
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => newID >= 0 && newID < maxDoc, () => "doc IDs must be in [0-" + maxDoc + "[, got " + newID);
- Debugging.Assert(() => i == oldID, () => "mapping is inconsistent: " + i + " --oldToNew--> " + newID + " --newToOld--> " + oldID);
+ Debugging.Assert(newID >= 0 && newID < maxDoc, () => "doc IDs must be in [0-" + maxDoc + "[, got " + newID);
+ Debugging.Assert(i == oldID, () => "mapping is inconsistent: " + i + " --oldToNew--> " + newID + " --newToOld--> " + oldID);
}
if (i != oldID || newID < 0 || newID >= maxDoc)
{
diff --git a/src/Lucene.Net.Misc/Index/Sorter/SortingAtomicReader.cs b/src/Lucene.Net.Misc/Index/Sorter/SortingAtomicReader.cs
index 6374533..bb6eace 100644
--- a/src/Lucene.Net.Misc/Index/Sorter/SortingAtomicReader.cs
+++ b/src/Lucene.Net.Misc/Index/Sorter/SortingAtomicReader.cs
@@ -761,7 +761,7 @@ namespace Lucene.Net.Index.Sorter
{
throw new ArgumentException("reader.MaxDoc should be equal to docMap.Count, got" + reader.MaxDoc + " != " + docMap.Count);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => Sorter.IsConsistent(docMap));
+ if (Debugging.AssertsEnabled) Debugging.Assert(Sorter.IsConsistent(docMap));
return new SortingAtomicReader(reader, docMap);
}
diff --git a/src/Lucene.Net.Misc/Index/Sorter/SortingMergePolicy.cs b/src/Lucene.Net.Misc/Index/Sorter/SortingMergePolicy.cs
index 7028244..c692723 100644
--- a/src/Lucene.Net.Misc/Index/Sorter/SortingMergePolicy.cs
+++ b/src/Lucene.Net.Misc/Index/Sorter/SortingMergePolicy.cs
@@ -134,7 +134,7 @@ namespace Lucene.Net.Index.Sorter
{
return base.GetDocMap(mergeState);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => mergeState.DocMaps.Length == 1); // we returned a singleton reader
+ if (Debugging.AssertsEnabled) Debugging.Assert(mergeState.DocMaps.Length == 1); // we returned a singleton reader
MonotonicAppendingInt64Buffer deletes = GetDeletes(unsortedReaders);
return new DocMapAnonymousInnerClassHelper(this, mergeState, deletes);
}
diff --git a/src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs b/src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs
index 03da23b..bf03c34 100644
--- a/src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs
+++ b/src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs
@@ -88,7 +88,7 @@ namespace Lucene.Net.Util.Fst
public override object Add(object prefix, object output)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !(prefix is IList));
+ if (Debugging.AssertsEnabled) Debugging.Assert(!(prefix is IList));
if (!(output is IList))
{
return outputs.Add((T)prefix, (T)output);
@@ -107,7 +107,7 @@ namespace Lucene.Net.Util.Fst
public override void Write(object output, DataOutput @out)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !(output is IList));
+ if (Debugging.AssertsEnabled) Debugging.Assert(!(output is IList));
outputs.Write((T)output, @out);
}
diff --git a/src/Lucene.Net.Misc/Util/Fst/UpToTwoPositiveIntOutputs.cs b/src/Lucene.Net.Misc/Util/Fst/UpToTwoPositiveIntOutputs.cs
index 40b4361..b5a3e93 100644
--- a/src/Lucene.Net.Misc/Util/Fst/UpToTwoPositiveIntOutputs.cs
+++ b/src/Lucene.Net.Misc/Util/Fst/UpToTwoPositiveIntOutputs.cs
@@ -72,8 +72,8 @@ namespace Lucene.Net.Util.Fst
this.second = second;
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => first >= 0);
- Debugging.Assert(() => second >= 0);
+ Debugging.Assert(first >= 0);
+ Debugging.Assert(second >= 0);
}
}
@@ -139,8 +139,8 @@ namespace Lucene.Net.Util.Fst
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => Valid(output1, false));
- Debugging.Assert(() => Valid(output2, false));
+ Debugging.Assert(Valid(output1, false));
+ Debugging.Assert(Valid(output2, false));
}
long? output1_ = (long?)output1;
long? output2_ = (long?)output2;
@@ -152,8 +152,8 @@ namespace Lucene.Net.Util.Fst
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => output1_ > 0);
- Debugging.Assert(() => output2_ > 0);
+ Debugging.Assert(output1_ > 0);
+ Debugging.Assert(output2_ > 0);
}
return Math.Min(output1_.GetValueOrDefault(), output2_.GetValueOrDefault());
}
@@ -171,12 +171,12 @@ namespace Lucene.Net.Util.Fst
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => Valid(output, false));
- Debugging.Assert(() => Valid(inc, false));
+ Debugging.Assert(Valid(output, false));
+ Debugging.Assert(Valid(inc, false));
}
long? output2 = (long?)output;
long? inc2 = (long?)inc;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => output2 >= inc2);
+ if (Debugging.AssertsEnabled) Debugging.Assert(output2 >= inc2);
if (inc2 == NO_OUTPUT)
{
@@ -194,8 +194,8 @@ namespace Lucene.Net.Util.Fst
public override object Add(object prefix, object output)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => Valid(prefix, false));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => Valid(output, true));
+ if (Debugging.AssertsEnabled) Debugging.Assert(Valid(prefix, false));
+ if (Debugging.AssertsEnabled) Debugging.Assert(Valid(output, true));
long? prefix2 = (long?)prefix;
if (output is long?)
{
@@ -223,7 +223,7 @@ namespace Lucene.Net.Util.Fst
public override void Write(object output, DataOutput @out)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => Valid(output, true));
+ if (Debugging.AssertsEnabled) Debugging.Assert(Valid(output, true));
if (output is long?)
{
long? output2 = (long?)output;
@@ -264,9 +264,9 @@ namespace Lucene.Net.Util.Fst
private bool Valid(long? o)
{
- Debugging.Assert(() => o != null);
- Debugging.Assert(() => o is long?);
- Debugging.Assert(() => o == NO_OUTPUT || o > 0);
+ Debugging.Assert(o != null);
+ Debugging.Assert(o is long?);
+ Debugging.Assert(o == NO_OUTPUT || o > 0);
return true;
}
@@ -275,7 +275,7 @@ namespace Lucene.Net.Util.Fst
{
if (!allowDouble)
{
- Debugging.Assert(() => o is long?);
+ Debugging.Assert(o is long?);
return Valid((long?)o);
}
else if (o is TwoInt64s)
@@ -300,8 +300,8 @@ namespace Lucene.Net.Util.Fst
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => Valid(first, false));
- Debugging.Assert(() => Valid(second, false));
+ Debugging.Assert(Valid(first, false));
+ Debugging.Assert(Valid(second, false));
}
return new TwoInt64s(((long?)first).GetValueOrDefault(), ((long?)second).GetValueOrDefault());
}
diff --git a/src/Lucene.Net.Queries/BooleanFilter.cs b/src/Lucene.Net.Queries/BooleanFilter.cs
index d15cee8..164985c 100644
--- a/src/Lucene.Net.Queries/BooleanFilter.cs
+++ b/src/Lucene.Net.Queries/BooleanFilter.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Queries
{
if (res == null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !hasShouldClauses);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!hasShouldClauses);
res = new FixedBitSet(reader.MaxDoc);
res.Set(0, reader.MaxDoc); // NOTE: may set bits on deleted docs
}
diff --git a/src/Lucene.Net.Queries/CommonTermsQuery.cs b/src/Lucene.Net.Queries/CommonTermsQuery.cs
index e78ce71..053ff1e 100644
--- a/src/Lucene.Net.Queries/CommonTermsQuery.cs
+++ b/src/Lucene.Net.Queries/CommonTermsQuery.cs
@@ -279,7 +279,7 @@ namespace Lucene.Net.Queries
continue;
}
termsEnum = terms.GetIterator(termsEnum);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termsEnum != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termsEnum != null);
if (termsEnum == TermsEnum.EMPTY)
{
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/AnalyzerQueryNodeProcessor.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/AnalyzerQueryNodeProcessor.cs
index f4d4c5f..5a220bf 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/AnalyzerQueryNodeProcessor.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/AnalyzerQueryNodeProcessor.cs
@@ -182,7 +182,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Processors
{
bool hasNext;
hasNext = buffer.IncrementToken();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => hasNext == true);
+ if (Debugging.AssertsEnabled) Debugging.Assert(hasNext == true);
term = termAtt.ToString();
}
#pragma warning disable 168
@@ -213,7 +213,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Processors
try
{
bool hasNext = buffer.IncrementToken();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => hasNext == true);
+ if (Debugging.AssertsEnabled) Debugging.Assert(hasNext == true);
term = termAtt.ToString();
}
#pragma warning disable 168
@@ -240,7 +240,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Processors
try
{
bool hasNext = buffer.IncrementToken();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => hasNext == true);
+ if (Debugging.AssertsEnabled) Debugging.Assert(hasNext == true);
term = termAtt.ToString();
}
#pragma warning disable 168
@@ -307,7 +307,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Processors
try
{
bool hasNext = buffer.IncrementToken();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => hasNext == true);
+ if (Debugging.AssertsEnabled) Debugging.Assert(hasNext == true);
term = termAtt.ToString();
if (posIncrAtt != null)
{
@@ -379,7 +379,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Processors
try
{
bool hasNext = buffer.IncrementToken();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => hasNext == true);
+ if (Debugging.AssertsEnabled) Debugging.Assert(hasNext == true);
term = termAtt.ToString();
if (posIncrAtt != null)
diff --git a/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs b/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs
index 009ad62..0cb8bac 100644
--- a/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs
+++ b/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs
@@ -242,7 +242,7 @@ namespace Lucene.Net.QueryParsers.Simple
private void ConsumeSubQuery(State state)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (m_flags & Operator.PRECEDENCE_OPERATORS) != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert((m_flags & Operator.PRECEDENCE_OPERATORS) != 0);
int start = ++state.Index;
int precedence = 1;
bool escaped = false;
@@ -315,7 +315,7 @@ namespace Lucene.Net.QueryParsers.Simple
private void ConsumePhrase(State state)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (m_flags & Operator.PHRASE_OPERATOR) != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert((m_flags & Operator.PHRASE_OPERATOR) != 0);
int start = ++state.Index;
int copied = 0;
bool escaped = false;
diff --git a/src/Lucene.Net.Replicator/IndexAndTaxonomyRevision.cs b/src/Lucene.Net.Replicator/IndexAndTaxonomyRevision.cs
index eddc6f0..8793c80 100644
--- a/src/Lucene.Net.Replicator/IndexAndTaxonomyRevision.cs
+++ b/src/Lucene.Net.Replicator/IndexAndTaxonomyRevision.cs
@@ -187,7 +187,7 @@ namespace Lucene.Net.Replicator
/// <exception cref="IOException"></exception>
public virtual Stream Open(string source, string fileName)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => source.Equals(INDEX_SOURCE, StringComparison.Ordinal) || source.Equals(TAXONOMY_SOURCE, StringComparison.Ordinal), () => string.Format("invalid source; expected=({0} or {1}) got={2}", INDEX_SOURCE, TAXONOMY_SOURCE, source));
+ if (Debugging.AssertsEnabled) Debugging.Assert(source.Equals(INDEX_SOURCE, StringComparison.Ordinal) || source.Equals(TAXONOMY_SOURCE, StringComparison.Ordinal), () => string.Format("invalid source; expected=({0} or {1}) got={2}", INDEX_SOURCE, TAXONOMY_SOURCE, source));
IndexCommit commit = source.Equals(INDEX_SOURCE, StringComparison.Ordinal) ? indexCommit : taxonomyCommit;
return new IndexInputStream(commit.Directory.OpenInput(fileName, IOContext.READ_ONCE));
}
diff --git a/src/Lucene.Net.Replicator/IndexRevision.cs b/src/Lucene.Net.Replicator/IndexRevision.cs
index 3a97ead..d454d13 100644
--- a/src/Lucene.Net.Replicator/IndexRevision.cs
+++ b/src/Lucene.Net.Replicator/IndexRevision.cs
@@ -134,7 +134,7 @@ namespace Lucene.Net.Replicator
public virtual Stream Open(string source, string fileName)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => source.Equals(SOURCE, StringComparison.Ordinal), () => string.Format("invalid source; expected={0} got={1}", SOURCE, source));
+ if (Debugging.AssertsEnabled) Debugging.Assert(source.Equals(SOURCE, StringComparison.Ordinal), () => string.Format("invalid source; expected={0} got={1}", SOURCE, source));
return new IndexInputStream(commit.Directory.OpenInput(fileName, IOContext.READ_ONCE));
}
diff --git a/src/Lucene.Net.Replicator/ReplicationClient.cs b/src/Lucene.Net.Replicator/ReplicationClient.cs
index 35251e6..a9a7844 100644
--- a/src/Lucene.Net.Replicator/ReplicationClient.cs
+++ b/src/Lucene.Net.Replicator/ReplicationClient.cs
@@ -370,7 +370,7 @@ namespace Lucene.Net.Replicator
// make sure to preserve revisionFiles order
List<RevisionFile> res = new List<RevisionFile>();
string source = e.Key;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => newRevisionFiles.ContainsKey(source), () => string.Format("source not found in newRevisionFiles: {0}", newRevisionFiles));
+ if (Debugging.AssertsEnabled) Debugging.Assert(newRevisionFiles.ContainsKey(source), () => string.Format("source not found in newRevisionFiles: {0}", newRevisionFiles));
foreach (RevisionFile file in newRevisionFiles[source])
{
if (!handlerFiles.Contains(file.FileName))
@@ -416,7 +416,7 @@ namespace Lucene.Net.Replicator
updateThread = new ReplicationThread(intervalMillis, threadName, DoUpdate, HandleUpdateException, updateLock);
updateThread.Start();
// we rely on isAlive to return true in isUpdateThreadAlive, assert to be on the safe side
- if (Debugging.AssertsEnabled) Debugging.Assert(() => updateThread.IsAlive, () => "updateThread started but not alive?");
+ if (Debugging.AssertsEnabled) Debugging.Assert(updateThread.IsAlive, () => "updateThread started but not alive?");
}
/// <summary>
diff --git a/src/Lucene.Net.Sandbox/Queries/SortedSetSortField.cs b/src/Lucene.Net.Sandbox/Queries/SortedSetSortField.cs
index 265e06f..34f2783 100644
--- a/src/Lucene.Net.Sandbox/Queries/SortedSetSortField.cs
+++ b/src/Lucene.Net.Sandbox/Queries/SortedSetSortField.cs
@@ -191,7 +191,7 @@ namespace Lucene.Net.Sandbox.Queries
case Selector.MIDDLE_MAX: return new MiddleMaxValue(randomOrds);
case Selector.MIN:
default:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false);
return null;
}
}
diff --git a/src/Lucene.Net.Spatial/Prefix/AbstractPrefixTreeFilter.cs b/src/Lucene.Net.Spatial/Prefix/AbstractPrefixTreeFilter.cs
index 3e5da90..2a906eb 100644
--- a/src/Lucene.Net.Spatial/Prefix/AbstractPrefixTreeFilter.cs
+++ b/src/Lucene.Net.Spatial/Prefix/AbstractPrefixTreeFilter.cs
@@ -113,7 +113,7 @@ namespace Lucene.Net.Spatial.Prefix
protected virtual void CollectDocs(FixedBitSet bitSet)
{
//WARN: keep this specialization in sync
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_termsEnum != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_termsEnum != null);
m_docsEnum = m_termsEnum.Docs(m_acceptDocs, m_docsEnum, DocsFlags.NONE);
int docid;
while ((docid = m_docsEnum.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS)
diff --git a/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs b/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs
index 033eb93..9edae90 100644
--- a/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs
+++ b/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs
@@ -52,7 +52,7 @@ namespace Lucene.Net.Spatial.Prefix
: base(queryShape, fieldName, grid, detailLevel)
{
this.m_prefixGridScanLevel = Math.Max(0, Math.Min(prefixGridScanLevel, grid.MaxLevels - 1));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => detailLevel <= grid.MaxLevels);
+ if (Debugging.AssertsEnabled) Debugging.Assert(detailLevel <= grid.MaxLevels);
}
public override bool Equals(object o)
@@ -135,7 +135,7 @@ namespace Lucene.Net.Spatial.Prefix
public virtual DocIdSet GetDocIdSet()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => curVNode == null, () => "Called more than once?");
+ if (Debugging.AssertsEnabled) Debugging.Assert(curVNode == null, () => "Called more than once?");
if (m_termsEnum == null)
{
return null;
@@ -169,7 +169,7 @@ namespace Lucene.Net.Spatial.Prefix
// LUCENENET IMPORTANT: Must not call this inline with Debug.Assert
// because the compiler removes Debug.Assert statements in release mode!!
bool hasNext = curVNode.children.MoveNext();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => hasNext);
+ if (Debugging.AssertsEnabled) Debugging.Assert(hasNext);
curVNode = curVNode.children.Current;
}
@@ -206,7 +206,7 @@ namespace Lucene.Net.Spatial.Prefix
if (compare > 0)
{
// leap frog (termsEnum is beyond where we would otherwise seek)
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !m_context.AtomicReader.GetTerms(m_outerInstance.m_fieldName).GetIterator(null).SeekExact(curVNodeTerm), () => "should be absent");
+ if (Debugging.AssertsEnabled) Debugging.Assert(!m_context.AtomicReader.GetTerms(m_outerInstance.m_fieldName).GetIterator(null).SeekExact(curVNodeTerm), () => "should be absent");
}
else
{
@@ -250,7 +250,7 @@ namespace Lucene.Net.Spatial.Prefix
/// <exception cref="IOException"></exception>
private void AddIntersectingChildren()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => thisTerm != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(thisTerm != null);
Cell cell = curVNode.cell;
if (cell.Level >= m_outerInstance.m_detailLevel)
{
@@ -261,7 +261,7 @@ namespace Lucene.Net.Spatial.Prefix
{
//If the next indexed term just adds a leaf marker ('+') to cell,
// then add all of those docs
- if (Debugging.AssertsEnabled) Debugging.Assert(() => StringHelper.StartsWith(thisTerm, curVNodeTerm));//TODO refactor to use method on curVNode.cell
+ if (Debugging.AssertsEnabled) Debugging.Assert(StringHelper.StartsWith(thisTerm, curVNodeTerm));//TODO refactor to use method on curVNode.cell
scanCell = m_outerInstance.m_grid.GetCell(thisTerm.Bytes, thisTerm.Offset, thisTerm.Length, scanCell);
if (scanCell.Level == cell.Level && scanCell.IsLeaf)
{
@@ -490,9 +490,9 @@ namespace Lucene.Net.Spatial.Prefix
internal virtual void Reset(Cell cell)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cell != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(cell != null);
this.cell = cell;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => children == null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(children == null);
}
}
diff --git a/src/Lucene.Net.Spatial/Prefix/ContainsPrefixTreeFilter.cs b/src/Lucene.Net.Spatial/Prefix/ContainsPrefixTreeFilter.cs
index 80d2039..88f2e3a 100644
--- a/src/Lucene.Net.Spatial/Prefix/ContainsPrefixTreeFilter.cs
+++ b/src/Lucene.Net.Spatial/Prefix/ContainsPrefixTreeFilter.cs
@@ -102,7 +102,7 @@ namespace Lucene.Net.Spatial.Prefix
if (cell.Level != 0 && ((cell.ShapeRel == SpatialRelation.NOT_SET || cell.ShapeRel == SpatialRelation.WITHIN)))
{
subCellsFilter = null;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cell.Shape.Relate(outerInstance.m_queryShape) == SpatialRelation.WITHIN);
+ if (Debugging.AssertsEnabled) Debugging.Assert(cell.Shape.Relate(outerInstance.m_queryShape) == SpatialRelation.WITHIN);
}
ICollection<Cell> subCells = cell.GetSubCells(subCellsFilter);
foreach (Cell subCell in subCells)
@@ -147,7 +147,7 @@ namespace Lucene.Net.Spatial.Prefix
private bool SeekExact(Cell cell)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => new BytesRef(cell.GetTokenBytes()).CompareTo(termBytes) > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(new BytesRef(cell.GetTokenBytes()).CompareTo(termBytes) > 0);
this.termBytes.Bytes = cell.GetTokenBytes();
this.termBytes.Length = this.termBytes.Bytes.Length;
if (m_termsEnum == null)
@@ -157,7 +157,7 @@ namespace Lucene.Net.Spatial.Prefix
private SmallDocSet GetDocs(Cell cell, IBits acceptContains)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => new BytesRef(cell.GetTokenBytes()).Equals(termBytes));
+ if (Debugging.AssertsEnabled) Debugging.Assert(new BytesRef(cell.GetTokenBytes()).Equals(termBytes));
return this.CollectDocs(acceptContains);
}
@@ -167,8 +167,8 @@ namespace Lucene.Net.Spatial.Prefix
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => new BytesRef(leafCell.GetTokenBytes()).Equals(termBytes));
- Debugging.Assert(() => !leafCell.Equals(lastLeaf));//don't call for same leaf again
+ Debugging.Assert(new BytesRef(leafCell.GetTokenBytes()).Equals(termBytes));
+ Debugging.Assert(!leafCell.Equals(lastLeaf));//don't call for same leaf again
}
lastLeaf = leafCell;
@@ -301,7 +301,7 @@ namespace Lucene.Net.Spatial.Prefix
}
docs[d++] = v;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => d == intSet.Count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(d == intSet.Count);
int size = d;
//sort them
Array.Sort(docs, 0, size);
diff --git a/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs b/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs
index e4fcc52..7ae545e 100644
--- a/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs
+++ b/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs
@@ -104,7 +104,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
public virtual void Reset(byte[] bytes, int off, int len)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => Level != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(Level != 0);
token = null;
m_shapeRel = SpatialRelation.NOT_SET;
this.bytes = bytes;
@@ -139,7 +139,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
/// <summary>Note: not supported at level 0.</summary>
public virtual void SetLeaf()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => Level != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(Level != 0);
m_leaf = true;
}
diff --git a/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs b/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs
index b6b76f4..a24056c 100644
--- a/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs
+++ b/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs
@@ -171,7 +171,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
IShape shape,
int maxLevel)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => str.Length == level);
+ if (Debugging.AssertsEnabled) Debugging.Assert(str.Length == level);
double w = levelW[level] / 2;
double h = levelH[level] / 2;
@@ -197,7 +197,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
IShape shape,
int maxLevel)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => str.Length == level);
+ if (Debugging.AssertsEnabled) Debugging.Assert(str.Length == level);
double w = levelW[level] / 2;
double h = levelH[level] / 2;
diff --git a/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTree.cs b/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTree.cs
index 36a45f3..3d00c3a 100644
--- a/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTree.cs
+++ b/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTree.cs
@@ -48,7 +48,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
public SpatialPrefixTree(SpatialContext ctx, int maxLevels)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => maxLevels > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(maxLevels > 0);
this.m_ctx = ctx;
this.m_maxLevels = maxLevels;
}
@@ -269,7 +269,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
return new ReadOnlyCollection<Cell>(new[] { cell });
}
string endToken = cell.TokenString;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => endToken.Length == detailLevel);
+ if (Debugging.AssertsEnabled) Debugging.Assert(endToken.Length == detailLevel);
IList<Cell> cells = new List<Cell>(detailLevel);
for (int i = 1; i < detailLevel; i++)
{
diff --git a/src/Lucene.Net.Spatial/Prefix/WithinPrefixTreeFilter.cs b/src/Lucene.Net.Spatial/Prefix/WithinPrefixTreeFilter.cs
index 5b33da7..ca1f64d 100644
--- a/src/Lucene.Net.Spatial/Prefix/WithinPrefixTreeFilter.cs
+++ b/src/Lucene.Net.Spatial/Prefix/WithinPrefixTreeFilter.cs
@@ -205,8 +205,8 @@ namespace Lucene.Net.Spatial.Prefix
//visitRelation is declared as a field, populated by visit() so we don't recompute it
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => m_outerInstance.m_detailLevel != cell.Level);
- Debugging.Assert(() => visitRelation == cell.Shape.Relate(m_outerInstance.m_queryShape));
+ Debugging.Assert(m_outerInstance.m_detailLevel != cell.Level);
+ Debugging.Assert(visitRelation == cell.Shape.Relate(m_outerInstance.m_queryShape));
}
if (AllCellsIntersectQuery(cell, visitRelation))
{
diff --git a/src/Lucene.Net.Spatial/Vector/DistanceValueSource.cs b/src/Lucene.Net.Spatial/Vector/DistanceValueSource.cs
index 391f23e..3b2fc96 100644
--- a/src/Lucene.Net.Spatial/Vector/DistanceValueSource.cs
+++ b/src/Lucene.Net.Spatial/Vector/DistanceValueSource.cs
@@ -104,7 +104,7 @@ namespace Lucene.Net.Spatial.Vector
// make sure it has minX and area
if (validX.Get(doc))
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => validY.Get(doc));
+ if (Debugging.AssertsEnabled) Debugging.Assert(validY.Get(doc));
return calculator.Distance(outerInstance.from, ptX.Get(doc), ptY.Get(doc)) * outerInstance.multiplier;
}
return nullValue;
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs
index 0be20a5..4cba458 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs
@@ -270,7 +270,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
IList<Transition> newTransitions = new List<Transition>();
foreach (Transition t in state.GetTransitions())
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => t.Min == t.Max);
+ if (Debugging.AssertsEnabled) Debugging.Assert(t.Min == t.Max);
if (t.Min == TokenStreamToAutomaton.POS_SEP)
{
if (preserveSep)
@@ -361,8 +361,8 @@ namespace Lucene.Net.Search.Suggest.Analyzing
long bCost = readerB.ReadInt32();
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => DecodeWeight(aCost) >= 0);
- Debugging.Assert(() => DecodeWeight(bCost) >= 0);
+ Debugging.Assert(DecodeWeight(aCost) >= 0);
+ Debugging.Assert(DecodeWeight(bCost) >= 0);
}
if (aCost < bCost)
{
@@ -490,7 +490,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
output.WriteBytes(surfaceForm.Bytes, surfaceForm.Offset, surfaceForm.Length);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => output.Position == requiredLength, () => output.Position + " vs " + requiredLength);
+ if (Debugging.AssertsEnabled) Debugging.Assert(output.Position == requiredLength, () => output.Position + " vs " + requiredLength);
writer.Write(buffer, 0, output.Position);
}
@@ -664,7 +664,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
break;
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sepIndex != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sepIndex != -1);
spare.Grow(sepIndex);
int payloadLen = output2.Length - sepIndex - 1;
@@ -710,7 +710,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => num > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(num > 0);
if (onlyMorePopular)
{
@@ -802,7 +802,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
}
var completions = searcher.Search();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => completions.IsComplete);
+ if (Debugging.AssertsEnabled) Debugging.Assert(completions.IsComplete);
// NOTE: this is rather inefficient: we enumerate
// every matching "exactly the same analyzed form"
@@ -845,7 +845,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
}
var completions2 = searcher2.Search();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => completions2.IsComplete);
+ if (Debugging.AssertsEnabled) Debugging.Assert(completions2.IsComplete);
foreach (Util.Fst.Util.Result<PairOutputs<long?, BytesRef>.Pair> completion in completions2)
{
@@ -923,7 +923,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
{
// We found exact match, which means we should
// have already found it in the first search:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => results.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(results.Count == 1);
return false;
}
else
@@ -967,7 +967,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
ReplaceSep(automaton);
automaton = ConvertAutomaton(automaton);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => SpecialOperations.IsFinite(automaton));
+ if (Debugging.AssertsEnabled) Debugging.Assert(SpecialOperations.IsFinite(automaton));
// Get all paths from the automaton (there can be
// more than one path, eg if the analyzer created a
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/BlendedInfixSuggester.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/BlendedInfixSuggester.cs
index a0c70e4..3b1c8f5 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/BlendedInfixSuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/BlendedInfixSuggester.cs
@@ -145,7 +145,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
{
BinaryDocValues textDV = MultiDocValues.GetBinaryValues(searcher.IndexReader, TEXT_FIELD_NAME);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => textDV != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(textDV != null);
// This will just be null if app didn't pass payloads to build():
// TODO: maybe just stored fields? they compress...
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs
index fbb56ad..53d613d 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs
@@ -69,7 +69,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
/// </summary>
public static IList<Path<T>> IntersectPrefixPaths<T>(Automaton a, FST<T> fst)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => a.IsDeterministic);
+ if (Debugging.AssertsEnabled) Debugging.Assert(a.IsDeterministic);
IList<Path<T>> queue = new List<Path<T>>();
List<Path<T>> endNodes = new List<Path<T>>();
queue.Add(new Path<T>(a.GetInitialState(), fst.GetFirstArc(new FST.Arc<T>()), fst.Outputs.NoOutput, new Int32sRef()));
@@ -120,8 +120,8 @@ namespace Lucene.Net.Search.Suggest.Analyzing
FST.Arc<T> nextArc = Lucene.Net.Util.Fst.Util.ReadCeilArc(min, fst, path.FstNode, scratchArc, fstReader);
while (nextArc != null && nextArc.Label <= max)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextArc.Label <= max);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextArc.Label >= min, () => nextArc.Label + " " + min);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextArc.Label <= max);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextArc.Label >= min, () => nextArc.Label + " " + min);
Int32sRef newInput = new Int32sRef(currentInput.Length + 1);
newInput.CopyInt32s(currentInput);
newInput.Int32s[currentInput.Length] = nextArc.Label;
@@ -130,7 +130,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
.CopyFrom(nextArc), fst.Outputs.Add(path.Output, nextArc.Output), newInput));
int label = nextArc.Label; // used in assert
nextArc = nextArc.IsLast ? null : fst.ReadNextRealArc(nextArc, fstReader);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextArc == null || label < nextArc.Label, () => "last: " + label + " next: " + (nextArc == null ? "" : nextArc.Label.ToString()));
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextArc == null || label < nextArc.Label, () => "last: " + label + " next: " + (nextArc == null ? "" : nextArc.Label.ToString()));
}
}
}
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs
index 2b79029..040d19a 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs
@@ -556,7 +556,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
// a separate dedicated att for this?
int gramCount = posLenAtt.PositionLength;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => gramCount <= grams);
+ if (Debugging.AssertsEnabled) Debugging.Assert(gramCount <= grams);
// Safety: make sure the recalculated count "agrees":
if (CountGrams(tokenBytes) != gramCount)
@@ -682,7 +682,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
{
BytesRef context = new BytesRef(token.Bytes, token.Offset, i);
long? output = Lucene.Net.Util.Fst.Util.Get(fst, Lucene.Net.Util.Fst.Util.ToInt32sRef(context, new Int32sRef()));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => output != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(output != null);
contextCount = DecodeWeight(output);
lastTokenFragment = new BytesRef(token.Bytes, token.Offset + i + 1, token.Length - i - 1);
break;
@@ -699,7 +699,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
{
finalLastToken = BytesRef.DeepCopyOf(lastTokenFragment);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => finalLastToken.Offset == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(finalLastToken.Offset == 0);
CharsRef spare = new CharsRef();
@@ -726,7 +726,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
searcher.AddStartPaths(arc, prefixOutput, true, new Int32sRef());
completions = searcher.Search();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => completions.IsComplete);
+ if (Debugging.AssertsEnabled) Debugging.Assert(completions.IsComplete);
}
catch (IOException bogus)
{
@@ -754,7 +754,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
{
if (token.Bytes[token.Offset + i] == separator)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => token.Length - i - 1 > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(token.Length - i - 1 > 0);
lastToken = new BytesRef(token.Bytes, token.Offset + i + 1, token.Length - i - 1);
break;
}
@@ -772,7 +772,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
// return numbers that are greater than long.MaxValue, which results in a negative long number.
(long)(long.MaxValue * (decimal)backoff * ((decimal)DecodeWeight(completion.Output)) / contextCount));
results.Add(result);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => results.Count == seen.Count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(results.Count == seen.Count);
//System.out.println(" add result=" + result);
nextCompletionContinue:;
}
@@ -874,7 +874,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
//private long decodeWeight(Pair<Long,BytesRef> output) {
private static long DecodeWeight(long? output)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => output != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(output != null);
return (int)(long.MaxValue - output); // LUCENENET TODO: Perhaps a Java Lucene bug? Why cast to int when returning long?
}
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/SuggestStopFilter.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/SuggestStopFilter.cs
index 8f909db..424420d 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/SuggestStopFilter.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/SuggestStopFilter.cs
@@ -115,7 +115,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
m_input.End();
endState = CaptureState();
int finalEndOffset = offsetAtt.EndOffset;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => finalEndOffset >= endOffset);
+ if (Debugging.AssertsEnabled) Debugging.Assert(finalEndOffset >= endOffset);
if (finalEndOffset > endOffset)
{
// OK there was a token separator after the
diff --git a/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs b/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs
index afdfc8d..0aa067e 100644
--- a/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs
@@ -407,7 +407,7 @@ namespace Lucene.Net.Search.Suggest.Fst
{
output.Bytes = ArrayUtil.Grow(output.Bytes);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => output.Offset == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(output.Offset == 0);
output.Bytes[output.Length++] = (byte) arc.Label;
FST.BytesReader fstReader = automaton.GetBytesReader();
automaton.ReadFirstTargetArc(arc, arc, fstReader);
diff --git a/src/Lucene.Net.Suggest/Suggest/Fst/WFSTCompletionLookup.cs b/src/Lucene.Net.Suggest/Suggest/Fst/WFSTCompletionLookup.cs
index 8efcd39..e793931 100644
--- a/src/Lucene.Net.Suggest/Suggest/Fst/WFSTCompletionLookup.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Fst/WFSTCompletionLookup.cs
@@ -140,7 +140,7 @@ namespace Lucene.Net.Search.Suggest.Fst
{
throw new ArgumentException("this suggester doesn't support contexts");
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => num > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(num > 0);
if (onlyMorePopular)
{
@@ -190,7 +190,7 @@ namespace Lucene.Net.Search.Suggest.Fst
try
{
completions = Lucene.Net.Util.Fst.Util.ShortestPaths(fst, arc, prefixOutput, weightComparer, num, !exactFirst);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => completions.IsComplete);
+ if (Debugging.AssertsEnabled) Debugging.Assert(completions.IsComplete);
}
catch (IOException bogus)
{
@@ -213,7 +213,7 @@ namespace Lucene.Net.Search.Suggest.Fst
private long? LookupPrefix(BytesRef scratch, FST.Arc<long?> arc) //Bogus
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => 0 == (long)fst.Outputs.NoOutput);
+ if (Debugging.AssertsEnabled) Debugging.Assert(0 == (long)fst.Outputs.NoOutput);
long output = 0;
var bytesReader = fst.GetBytesReader();
@@ -294,7 +294,7 @@ namespace Lucene.Net.Search.Suggest.Fst
: base(source)
{
this.outerInstance = outerInstance;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => source.HasPayloads == false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(source.HasPayloads == false);
}
protected internal override void Encode(OfflineSorter.ByteSequencesWriter writer, ByteArrayDataOutput output, byte[] buffer, BytesRef spare, BytesRef payload, ICollection<BytesRef> contexts, long weight)
diff --git a/src/Lucene.Net.Suggest/Suggest/UnsortedInputIterator.cs b/src/Lucene.Net.Suggest/Suggest/UnsortedInputIterator.cs
index 4b8791f..d7891b7 100644
--- a/src/Lucene.Net.Suggest/Suggest/UnsortedInputIterator.cs
+++ b/src/Lucene.Net.Suggest/Suggest/UnsortedInputIterator.cs
@@ -62,7 +62,7 @@ namespace Lucene.Net.Search.Suggest
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentOrd == ords[m_curPos]);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentOrd == ords[m_curPos]);
return m_freqs[currentOrd];
}
}
@@ -83,7 +83,7 @@ namespace Lucene.Net.Search.Suggest
{
if (HasPayloads && m_curPos < m_payloads.Length)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentOrd == ords[m_curPos]);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentOrd == ords[m_curPos]);
return m_payloads.Get(payloadSpare, currentOrd);
}
return null;
@@ -96,7 +96,7 @@ namespace Lucene.Net.Search.Suggest
{
if (HasContexts && m_curPos < m_contextSets.Count)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentOrd == ords[m_curPos]);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentOrd == ords[m_curPos]);
return m_contextSets[currentOrd];
}
return null;
diff --git a/src/Lucene.Net.TestFramework/Analysis/LookaheadTokenFilter.cs b/src/Lucene.Net.TestFramework/Analysis/LookaheadTokenFilter.cs
index f20029b..ba0518b 100644
--- a/src/Lucene.Net.TestFramework/Analysis/LookaheadTokenFilter.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/LookaheadTokenFilter.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Analysis
public virtual AttributeSource.State NextState()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => NextRead < InputTokens.Count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(NextRead < InputTokens.Count);
return InputTokens[NextRead++];
}
}
@@ -141,7 +141,7 @@ namespace Lucene.Net.Analysis
m_positions.Get(m_inputPos).Add(CaptureState());
tokenPending = false;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !insertPending);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!insertPending);
insertPending = true;
}
@@ -184,8 +184,8 @@ namespace Lucene.Net.Analysis
{
Console.WriteLine("LTF.peekToken inputPos=" + m_inputPos + " outputPos=" + m_outputPos + " tokenPending=" + tokenPending);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !m_end);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_inputPos == -1 || m_outputPos <= m_inputPos);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!m_end);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_inputPos == -1 || m_outputPos <= m_inputPos);
if (tokenPending)
{
m_positions.Get(m_inputPos).Add(CaptureState());
@@ -199,7 +199,7 @@ namespace Lucene.Net.Analysis
if (gotToken)
{
m_inputPos += m_posIncAtt.PositionIncrement;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_inputPos >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_inputPos >= 0);
if (DEBUG)
{
Console.WriteLine(" now inputPos=" + m_inputPos);
@@ -216,7 +216,7 @@ namespace Lucene.Net.Analysis
else
{
// Make sure our input isn't messing up offsets:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => startPosData.StartOffset == startOffset, () => "prev startOffset=" + startPosData.StartOffset + " vs new startOffset=" + startOffset + " inputPos=" + m_inputPos);
+ if (Debugging.AssertsEnabled) Debugging.Assert(startPosData.StartOffset == startOffset, () => "prev startOffset=" + startPosData.StartOffset + " vs new startOffset=" + startOffset + " inputPos=" + m_inputPos);
}
int endOffset = m_offsetAtt.EndOffset;
@@ -227,7 +227,7 @@ namespace Lucene.Net.Analysis
else
{
// Make sure our input isn't messing up offsets:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => endPosData.EndOffset == endOffset, () => "prev endOffset=" + endPosData.EndOffset + " vs new endOffset=" + endOffset + " inputPos=" + m_inputPos);
+ if (Debugging.AssertsEnabled) Debugging.Assert(endPosData.EndOffset == endOffset, () => "prev endOffset=" + endPosData.EndOffset + " vs new endOffset=" + endOffset + " inputPos=" + m_inputPos);
}
tokenPending = true;
@@ -314,7 +314,7 @@ namespace Lucene.Net.Analysis
{
Console.WriteLine(" return inserted token");
}
- if (Debugging.AssertsEnabled) Debugging.Assert(InsertedTokenConsistent);
+ if (Debugging.AssertsEnabled) Debugging.Assert(InsertedTokenConsistent());
insertPending = false;
return true;
}
@@ -340,7 +340,7 @@ namespace Lucene.Net.Analysis
{
Console.WriteLine(" return inserted token");
}
- if (Debugging.AssertsEnabled) Debugging.Assert(InsertedTokenConsistent);
+ if (Debugging.AssertsEnabled) Debugging.Assert(InsertedTokenConsistent());
insertPending = false;
return true;
}
@@ -364,8 +364,8 @@ namespace Lucene.Net.Analysis
{
int posLen = m_posLenAtt.PositionLength;
Position endPosData = m_positions.Get(m_outputPos + posLen);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => endPosData.EndOffset != -1);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m_offsetAtt.EndOffset == endPosData.EndOffset, () => "offsetAtt.endOffset=" + m_offsetAtt.EndOffset + " vs expected=" + endPosData.EndOffset);
+ if (Debugging.AssertsEnabled) Debugging.Assert(endPosData.EndOffset != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m_offsetAtt.EndOffset == endPosData.EndOffset, () => "offsetAtt.endOffset=" + m_offsetAtt.EndOffset + " vs expected=" + endPosData.EndOffset);
return true;
}
diff --git a/src/Lucene.Net.TestFramework/Analysis/MockCharFilter.cs b/src/Lucene.Net.TestFramework/Analysis/MockCharFilter.cs
index 0b377d1..d7ef75e 100644
--- a/src/Lucene.Net.TestFramework/Analysis/MockCharFilter.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/MockCharFilter.cs
@@ -112,7 +112,7 @@ namespace Lucene.Net.Analysis
ret = currentOff;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ret >= 0, () => "currentOff=" + currentOff + ",diff=" + (ret - currentOff));
+ if (Debugging.AssertsEnabled) Debugging.Assert(ret >= 0, () => "currentOff=" + currentOff + ",diff=" + (ret - currentOff));
return ret;
}
diff --git a/src/Lucene.Net.TestFramework/Analysis/MockReaderWrapper.cs b/src/Lucene.Net.TestFramework/Analysis/MockReaderWrapper.cs
index 49bbebf..f7527ca 100644
--- a/src/Lucene.Net.TestFramework/Analysis/MockReaderWrapper.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/MockReaderWrapper.cs
@@ -47,7 +47,7 @@ namespace Lucene.Net.Analysis
{
excAtChar = charUpto;
// You should only call this on init!:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => 0 == readSoFar);
+ if (Debugging.AssertsEnabled) Debugging.Assert(0 == readSoFar);
}
public virtual void ThrowExcNext()
@@ -91,10 +91,10 @@ namespace Lucene.Net.Analysis
if (excAtChar != -1)
{
int left = excAtChar - readSoFar;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => left != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(left != 0);
read = input.Read(cbuf, off, Math.Min(realLen, left));
//Characters are left
- if (Debugging.AssertsEnabled) Debugging.Assert(() => read != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(read != 0);
readSoFar += read;
}
else
diff --git a/src/Lucene.Net.TestFramework/Analysis/MockTokenizer.cs b/src/Lucene.Net.TestFramework/Analysis/MockTokenizer.cs
index 50152f6..d6da069 100644
--- a/src/Lucene.Net.TestFramework/Analysis/MockTokenizer.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/MockTokenizer.cs
@@ -140,7 +140,7 @@ namespace Lucene.Net.Analysis
public sealed override bool IncrementToken()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !enableChecks || (streamState == State.RESET || streamState == State.INCREMENT), () => "IncrementToken() called while in wrong state: " + streamState);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!enableChecks || (streamState == State.RESET || streamState == State.INCREMENT), () => "IncrementToken() called while in wrong state: " + streamState);
ClearAttributes();
for (; ; )
{
@@ -219,7 +219,7 @@ namespace Lucene.Net.Analysis
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !char.IsLowSurrogate((char)ch), () => "unpaired low surrogate: " + ch.ToString("x"));
+ if (Debugging.AssertsEnabled) Debugging.Assert(!char.IsLowSurrogate((char)ch), () => "unpaired low surrogate: " + ch.ToString("x"));
off++;
if (char.IsHighSurrogate((char)ch))
{
@@ -227,12 +227,12 @@ namespace Lucene.Net.Analysis
if (ch2 >= 0)
{
off++;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => char.IsLowSurrogate((char)ch2), () => "unpaired high surrogate: " + ch.ToString("x") + ", followed by: " + ch2.ToString("x"));
+ if (Debugging.AssertsEnabled) Debugging.Assert(char.IsLowSurrogate((char)ch2), () => "unpaired high surrogate: " + ch.ToString("x") + ", followed by: " + ch2.ToString("x"));
return Character.ToCodePoint((char)ch, (char)ch2);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "stream ends with unpaired high surrogate: " + ch.ToString("x"));
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "stream ends with unpaired high surrogate: " + ch.ToString("x"));
}
}
return ch;
@@ -300,7 +300,7 @@ namespace Lucene.Net.Analysis
state = runAutomaton.InitialState;
lastOffset = off = 0;
bufferedCodePoint = -1;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !enableChecks || streamState != State.RESET, () => "Double Reset()");
+ if (Debugging.AssertsEnabled) Debugging.Assert(!enableChecks || streamState != State.RESET, () => "Double Reset()");
streamState = State.RESET;
}
@@ -312,14 +312,14 @@ namespace Lucene.Net.Analysis
// in some exceptional cases (e.g. TestIndexWriterExceptions) a test can prematurely close()
// these tests should disable this check, by default we check the normal workflow.
// TODO: investigate the CachingTokenFilter "double-close"... for now we ignore this
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !enableChecks || streamState == State.END || streamState == State.CLOSE, () => "Dispose() called in wrong state: " + streamState);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!enableChecks || streamState == State.END || streamState == State.CLOSE, () => "Dispose() called in wrong state: " + streamState);
streamState = State.CLOSE;
}
}
internal override bool SetReaderTestPoint()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !enableChecks || streamState == State.CLOSE, () => "SetReader() called in wrong state: " + streamState);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!enableChecks || streamState == State.CLOSE, () => "SetReader() called in wrong state: " + streamState);
streamState = State.SETREADER;
return true;
}
@@ -333,7 +333,7 @@ namespace Lucene.Net.Analysis
// these tests should disable this check (in general you should consume the entire stream)
try
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !enableChecks || streamState == State.INCREMENT_FALSE, () => "End() called before IncrementToken() returned false!");
+ if (Debugging.AssertsEnabled) Debugging.Assert(!enableChecks || streamState == State.INCREMENT_FALSE, () => "End() called before IncrementToken() returned false!");
}
finally
{
diff --git a/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingDocValuesFormat.cs b/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingDocValuesFormat.cs
index 486a980..e2da7b6 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingDocValuesFormat.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingDocValuesFormat.cs
@@ -40,15 +40,15 @@ namespace Lucene.Net.Codecs.Asserting
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state)
{
DocValuesConsumer consumer = @in.FieldsConsumer(state);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => consumer != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(consumer != null);
return new AssertingDocValuesConsumer(consumer, state.SegmentInfo.DocCount);
}
public override DocValuesProducer FieldsProducer(SegmentReadState state)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state.FieldInfos.HasDocValues);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state.FieldInfos.HasDocValues);
DocValuesProducer producer = @in.FieldsProducer(state);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => producer != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(producer != null);
return new AssertingDocValuesProducer(producer, state.SegmentInfo.DocCount);
}
@@ -70,7 +70,7 @@ namespace Lucene.Net.Codecs.Asserting
{
count++;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => count == maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(count == maxDoc);
CheckIterator(values.GetEnumerator(), maxDoc, true);
@in.AddNumericField(field, values);
}
@@ -80,10 +80,10 @@ namespace Lucene.Net.Codecs.Asserting
int count = 0;
foreach (BytesRef b in values)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => b == null || b.IsValid());
+ if (Debugging.AssertsEnabled) Debugging.Assert(b == null || b.IsValid());
count++;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => count == maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(count == maxDoc);
CheckIterator(values.GetEnumerator(), maxDoc, true);
@in.AddBinaryField(field, values);
}
@@ -94,25 +94,25 @@ namespace Lucene.Net.Codecs.Asserting
BytesRef lastValue = null;
foreach (BytesRef b in values)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => b != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => b.IsValid());
+ if (Debugging.AssertsEnabled) Debugging.Assert(b != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(b.IsValid());
if (valueCount > 0)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => b.CompareTo(lastValue) > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(b.CompareTo(lastValue) > 0);
}
lastValue = BytesRef.DeepCopyOf(b);
valueCount++;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valueCount <= maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(valueCount <= maxDoc);
FixedBitSet seenOrds = new FixedBitSet(valueCount);
int count = 0;
foreach (long? v in docToOrd)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => v != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(v != null);
int ord = (int)v.Value;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord >= -1 && ord < valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord >= -1 && ord < valueCount);
if (ord >= 0)
{
seenOrds.Set(ord);
@@ -120,8 +120,8 @@ namespace Lucene.Net.Codecs.Asserting
count++;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => count == maxDoc);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => seenOrds.Cardinality() == valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(count == maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(seenOrds.Cardinality() == valueCount);
CheckIterator(values.GetEnumerator(), valueCount, false);
CheckIterator(docToOrd.GetEnumerator(), maxDoc, false);
@in.AddSortedField(field, values, docToOrd);
@@ -133,11 +133,11 @@ namespace Lucene.Net.Codecs.Asserting
BytesRef lastValue = null;
foreach (BytesRef b in values)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => b != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => b.IsValid());
+ if (Debugging.AssertsEnabled) Debugging.Assert(b != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(b.IsValid());
if (valueCount > 0)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => b.CompareTo(lastValue) > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(b.CompareTo(lastValue) > 0);
}
lastValue = BytesRef.DeepCopyOf(b);
valueCount++;
@@ -150,9 +150,9 @@ namespace Lucene.Net.Codecs.Asserting
{
foreach (long? v in docToOrdCount)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => v != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(v != null);
int count = (int)v.Value;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => count >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(count >= 0);
docCount++;
ordCount += count;
@@ -161,18 +161,18 @@ namespace Lucene.Net.Codecs.Asserting
{
ordIterator.MoveNext();
long? o = ordIterator.Current;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => o != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(o != null);
long ord = o.Value;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord >= 0 && ord < valueCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord > lastOrd, () => "ord=" + ord + ",lastOrd=" + lastOrd);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord >= 0 && ord < valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord > lastOrd, () => "ord=" + ord + ",lastOrd=" + lastOrd);
seenOrds.Set(ord);
lastOrd = ord;
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ordIterator.MoveNext() == false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ordIterator.MoveNext() == false);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docCount == maxDoc);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => seenOrds.Cardinality() == valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docCount == maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(seenOrds.Cardinality() == valueCount);
CheckIterator(values.GetEnumerator(), valueCount, false);
CheckIterator(docToOrdCount.GetEnumerator(), maxDoc, false);
CheckIterator(ords.GetEnumerator(), ordCount, false);
@@ -203,10 +203,10 @@ namespace Lucene.Net.Codecs.Asserting
int count = 0;
foreach (long? v in values)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => v != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(v != null);
count++;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => count == maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(count == maxDoc);
CheckIterator(values.GetEnumerator(), maxDoc, false);
@in.AddNumericField(field, values);
}
@@ -240,9 +240,9 @@ namespace Lucene.Net.Codecs.Asserting
for (long i = 0; i < expectedSize; i++)
{
bool hasNext = iterator.MoveNext();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => hasNext);
+ if (Debugging.AssertsEnabled) Debugging.Assert(hasNext);
T v = iterator.Current;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => allowNull || v != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(allowNull || v != null);
// LUCENE.NET specific. removed call to Reset().
//try
@@ -255,7 +255,7 @@ namespace Lucene.Net.Codecs.Asserting
// // ok
//}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !iterator.MoveNext());
+ if (Debugging.AssertsEnabled) Debugging.Assert(!iterator.MoveNext());
/*try
{
//iterator.next();
@@ -285,42 +285,42 @@ namespace Lucene.Net.Codecs.Asserting
public override NumericDocValues GetNumeric(FieldInfo field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field.DocValuesType == DocValuesType.NUMERIC || field.NormType == DocValuesType.NUMERIC);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field.DocValuesType == DocValuesType.NUMERIC || field.NormType == DocValuesType.NUMERIC);
NumericDocValues values = @in.GetNumeric(field);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => values != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(values != null);
return new AssertingNumericDocValues(values, maxDoc);
}
public override BinaryDocValues GetBinary(FieldInfo field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field.DocValuesType == DocValuesType.BINARY);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field.DocValuesType == DocValuesType.BINARY);
BinaryDocValues values = @in.GetBinary(field);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => values != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(values != null);
return new AssertingBinaryDocValues(values, maxDoc);
}
public override SortedDocValues GetSorted(FieldInfo field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field.DocValuesType == DocValuesType.SORTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field.DocValuesType == DocValuesType.SORTED);
SortedDocValues values = @in.GetSorted(field);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => values != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(values != null);
return new AssertingSortedDocValues(values, maxDoc);
}
public override SortedSetDocValues GetSortedSet(FieldInfo field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field.DocValuesType == DocValuesType.SORTED_SET);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field.DocValuesType == DocValuesType.SORTED_SET);
SortedSetDocValues values = @in.GetSortedSet(field);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => values != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(values != null);
return new AssertingSortedSetDocValues(values, maxDoc);
}
public override IBits GetDocsWithField(FieldInfo field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field.DocValuesType != DocValuesType.NONE);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field.DocValuesType != DocValuesType.NONE);
IBits bits = @in.GetDocsWithField(field);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => bits != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => bits.Length == maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(bits != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(bits.Length == maxDoc);
return new AssertingBits(bits);
}
diff --git a/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingNormsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingNormsFormat.cs
index ea40b54..1e87622 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingNormsFormat.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingNormsFormat.cs
@@ -32,15 +32,15 @@ namespace Lucene.Net.Codecs.Asserting
public override DocValuesConsumer NormsConsumer(SegmentWriteState state)
{
DocValuesConsumer consumer = @in.NormsConsumer(state);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => consumer != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(consumer != null);
return new AssertingNormsConsumer(consumer, state.SegmentInfo.DocCount);
}
public override DocValuesProducer NormsProducer(SegmentReadState state)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state.FieldInfos.HasNorms);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state.FieldInfos.HasNorms);
DocValuesProducer producer = @in.NormsProducer(state);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => producer != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(producer != null);
return new AssertingDocValuesProducer(producer, state.SegmentInfo.DocCount);
}
}
diff --git a/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingPostingsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingPostingsFormat.cs
index 69e981f..f0e3fc2 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingPostingsFormat.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingPostingsFormat.cs
@@ -67,7 +67,7 @@ namespace Lucene.Net.Codecs.Asserting
public override IEnumerator<string> GetEnumerator()
{
IEnumerator<string> iterator = @in.GetEnumerator();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => iterator != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(iterator != null);
return iterator;
}
@@ -105,7 +105,7 @@ namespace Lucene.Net.Codecs.Asserting
public override TermsConsumer AddField(FieldInfo field)
{
TermsConsumer consumer = @in.AddField(field);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => consumer != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(consumer != null);
return new AssertingTermsConsumer(consumer, field);
}
@@ -144,28 +144,28 @@ namespace Lucene.Net.Codecs.Asserting
public override PostingsConsumer StartTerm(BytesRef text)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == TermsConsumerState.INITIAL || state == TermsConsumerState.START && lastPostingsConsumer.docFreq == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == TermsConsumerState.INITIAL || state == TermsConsumerState.START && lastPostingsConsumer.docFreq == 0);
state = TermsConsumerState.START;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => lastTerm == null || @in.Comparer.Compare(text, lastTerm) > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(lastTerm == null || @in.Comparer.Compare(text, lastTerm) > 0);
lastTerm = BytesRef.DeepCopyOf(text);
return lastPostingsConsumer = new AssertingPostingsConsumer(@in.StartTerm(text), fieldInfo, visitedDocs);
}
public override void FinishTerm(BytesRef text, TermStats stats)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == TermsConsumerState.START);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == TermsConsumerState.START);
state = TermsConsumerState.INITIAL;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => text.Equals(lastTerm));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stats.DocFreq > 0); // otherwise, this method should not be called.
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stats.DocFreq == lastPostingsConsumer.docFreq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(text.Equals(lastTerm));
+ if (Debugging.AssertsEnabled) Debugging.Assert(stats.DocFreq > 0); // otherwise, this method should not be called.
+ if (Debugging.AssertsEnabled) Debugging.Assert(stats.DocFreq == lastPostingsConsumer.docFreq);
sumDocFreq += stats.DocFreq;
if (fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stats.TotalTermFreq == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stats.TotalTermFreq == -1);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stats.TotalTermFreq == lastPostingsConsumer.totalTermFreq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stats.TotalTermFreq == lastPostingsConsumer.totalTermFreq);
sumTotalTermFreq += stats.TotalTermFreq;
}
@in.FinishTerm(text, stats);
@@ -173,20 +173,20 @@ namespace Lucene.Net.Codecs.Asserting
public override void Finish(long sumTotalTermFreq, long sumDocFreq, int docCount)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == TermsConsumerState.INITIAL || state == TermsConsumerState.START && lastPostingsConsumer.docFreq == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == TermsConsumerState.INITIAL || state == TermsConsumerState.START && lastPostingsConsumer.docFreq == 0);
state = TermsConsumerState.FINISHED;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docCount >= 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docCount == visitedDocs.Cardinality());
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sumDocFreq >= docCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sumDocFreq == this.sumDocFreq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docCount >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docCount == visitedDocs.Cardinality());
+ if (Debugging.AssertsEnabled) Debugging.Assert(sumDocFreq >= docCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sumDocFreq == this.sumDocFreq);
if (fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sumTotalTermFreq == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sumTotalTermFreq == -1);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sumTotalTermFreq >= sumDocFreq);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sumTotalTermFreq == this.sumTotalTermFreq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sumTotalTermFreq >= sumDocFreq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sumTotalTermFreq == this.sumTotalTermFreq);
}
@in.Finish(sumTotalTermFreq, sumDocFreq, docCount);
}
@@ -222,17 +222,17 @@ namespace Lucene.Net.Codecs.Asserting
public override void StartDoc(int docID, int freq)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == PostingsConsumerState.INITIAL);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == PostingsConsumerState.INITIAL);
state = PostingsConsumerState.START;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docID >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docID >= 0);
if (fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => freq == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(freq == -1);
this.freq = 0; // we don't expect any positions here
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => freq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(freq > 0);
this.freq = freq;
totalTermFreq += freq;
}
@@ -246,41 +246,41 @@ namespace Lucene.Net.Codecs.Asserting
public override void AddPosition(int position, BytesRef payload, int startOffset, int endOffset)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == PostingsConsumerState.START);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => positionCount < freq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == PostingsConsumerState.START);
+ if (Debugging.AssertsEnabled) Debugging.Assert(positionCount < freq);
positionCount++;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => position >= lastPosition || position == -1); // we still allow -1 from old 3.x indexes
+ if (Debugging.AssertsEnabled) Debugging.Assert(position >= lastPosition || position == -1); // we still allow -1 from old 3.x indexes
lastPosition = position;
if (fieldInfo.IndexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => startOffset >= 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => startOffset >= lastStartOffset);
+ if (Debugging.AssertsEnabled) Debugging.Assert(startOffset >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(startOffset >= lastStartOffset);
lastStartOffset = startOffset;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => endOffset >= startOffset);
+ if (Debugging.AssertsEnabled) Debugging.Assert(endOffset >= startOffset);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => startOffset == -1);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => endOffset == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(startOffset == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(endOffset == -1);
}
if (payload != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldInfo.HasPayloads);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldInfo.HasPayloads);
}
@in.AddPosition(position, payload, startOffset, endOffset);
}
public override void FinishDoc()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == PostingsConsumerState.START);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == PostingsConsumerState.START);
state = PostingsConsumerState.INITIAL;
if (fieldInfo.IndexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) < 0)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => positionCount == 0); // we should not have fed any positions!
+ if (Debugging.AssertsEnabled) Debugging.Assert(positionCount == 0); // we should not have fed any positions!
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => positionCount == freq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(positionCount == freq);
}
@in.FinishDoc();
}
diff --git a/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingStoredFieldsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingStoredFieldsFormat.cs
index d4d9d76..fa3514e 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingStoredFieldsFormat.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingStoredFieldsFormat.cs
@@ -58,7 +58,7 @@ namespace Lucene.Net.Codecs.Asserting
public override void VisitDocument(int n, StoredFieldVisitor visitor)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => n >= 0 && n < maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(n >= 0 && n < maxDoc);
@in.VisitDocument(n, visitor);
}
@@ -100,9 +100,9 @@ namespace Lucene.Net.Codecs.Asserting
public override void StartDocument(int numStoredFields)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus != Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus != Status.STARTED);
@in.StartDocument(numStoredFields);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldCount == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldCount == 0);
fieldCount = numStoredFields;
numWritten++;
docStatus = Status.STARTED;
@@ -110,17 +110,17 @@ namespace Lucene.Net.Codecs.Asserting
public override void FinishDocument()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus == Status.STARTED);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldCount == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldCount == 0);
@in.FinishDocument();
docStatus = Status.FINISHED;
}
public override void WriteField(FieldInfo info, IIndexableField field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus == Status.STARTED);
@in.WriteField(info, field);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldCount > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldCount > 0);
fieldCount--;
}
@@ -131,10 +131,10 @@ namespace Lucene.Net.Codecs.Asserting
public override void Finish(FieldInfos fis, int numDocs)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus == (numDocs > 0 ? Status.FINISHED : Status.UNDEFINED));
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus == (numDocs > 0 ? Status.FINISHED : Status.UNDEFINED));
@in.Finish(fis, numDocs);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldCount == 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numDocs == numWritten);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldCount == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numDocs == numWritten);
}
protected override void Dispose(bool disposing)
diff --git a/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingTermVectorsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingTermVectorsFormat.cs
index b7ce230..dd538b9 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingTermVectorsFormat.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Asserting/AssertingTermVectorsFormat.cs
@@ -103,8 +103,8 @@ namespace Lucene.Net.Codecs.Asserting
public override void StartDocument(int numVectorFields)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldCount == 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus != Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldCount == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus != Status.STARTED);
@in.StartDocument(numVectorFields);
docStatus = Status.STARTED;
fieldCount = numVectorFields;
@@ -113,17 +113,17 @@ namespace Lucene.Net.Codecs.Asserting
public override void FinishDocument()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldCount == 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldCount == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus == Status.STARTED);
@in.FinishDocument();
docStatus = Status.FINISHED;
}
public override void StartField(FieldInfo info, int numTerms, bool positions, bool offsets, bool payloads)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termCount == 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus == Status.STARTED);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldStatus != Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termCount == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldStatus != Status.STARTED);
@in.StartField(info, numTerms, positions, offsets, payloads);
fieldStatus = Status.STARTED;
termCount = numTerms;
@@ -132,8 +132,8 @@ namespace Lucene.Net.Codecs.Asserting
public override void FinishField()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termCount == 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termCount == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldStatus == Status.STARTED);
@in.FinishField();
fieldStatus = Status.FINISHED;
--fieldCount;
@@ -141,9 +141,9 @@ namespace Lucene.Net.Codecs.Asserting
public override void StartTerm(BytesRef term, int freq)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus == Status.STARTED);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldStatus == Status.STARTED);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termStatus != Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termStatus != Status.STARTED);
@in.StartTerm(term, freq);
termStatus = Status.STARTED;
positionCount = hasPositions ? freq : 0;
@@ -151,10 +151,10 @@ namespace Lucene.Net.Codecs.Asserting
public override void FinishTerm()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => positionCount == 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus == Status.STARTED);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldStatus == Status.STARTED);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(positionCount == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termStatus == Status.STARTED);
@in.FinishTerm();
termStatus = Status.FINISHED;
--termCount;
@@ -162,9 +162,9 @@ namespace Lucene.Net.Codecs.Asserting
public override void AddPosition(int position, int startOffset, int endOffset, BytesRef payload)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus == Status.STARTED);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldStatus == Status.STARTED);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldStatus == Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termStatus == Status.STARTED);
@in.AddPosition(position, startOffset, endOffset, payload);
--positionCount;
}
@@ -176,10 +176,10 @@ namespace Lucene.Net.Codecs.Asserting
public override void Finish(FieldInfos fis, int numDocs)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docCount == numDocs);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docStatus == (numDocs > 0 ? Status.FINISHED : Status.UNDEFINED));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldStatus != Status.STARTED);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termStatus != Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docCount == numDocs);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docStatus == (numDocs > 0 ? Status.FINISHED : Status.UNDEFINED));
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldStatus != Status.STARTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termStatus != Status.STARTED);
@in.Finish(fis, numDocs);
}
diff --git a/src/Lucene.Net.TestFramework/Codecs/Compressing/Dummy/DummyCompressingCodec.cs b/src/Lucene.Net.TestFramework/Codecs/Compressing/Dummy/DummyCompressingCodec.cs
index ae218dd..f1eef1b 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Compressing/Dummy/DummyCompressingCodec.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Compressing/Dummy/DummyCompressingCodec.cs
@@ -57,7 +57,7 @@ namespace Lucene.Net.Codecs.Compressing.Dummy
{
public override void Decompress(DataInput @in, int originalLength, int offset, int length, BytesRef bytes)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => offset + length <= originalLength);
+ if (Debugging.AssertsEnabled) Debugging.Assert(offset + length <= originalLength);
if (bytes.Bytes.Length < originalLength)
{
bytes.Bytes = new byte[ArrayUtil.Oversize(originalLength, 1)];
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWFieldInfosWriter.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWFieldInfosWriter.cs
index 8a461be..0538bdc 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWFieldInfosWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWFieldInfosWriter.cs
@@ -79,7 +79,7 @@ namespace Lucene.Net.Codecs.Lucene3x
if (fi.IsIndexed)
{
bits |= IS_INDEXED;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi.IndexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS || !fi.HasPayloads);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi.IndexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS || !fi.HasPayloads);
if (fi.IndexOptions == IndexOptions.DOCS_ONLY)
{
bits |= OMIT_TERM_FREQ_AND_POSITIONS;
@@ -103,7 +103,7 @@ namespace Lucene.Net.Codecs.Lucene3x
// only in RW case
output.WriteByte((byte)(sbyte)(fi.NormType == Index.DocValuesType.NONE ? 0 : 1));
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi.Attributes == null); // not used or supported
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi.Attributes == null); // not used or supported
}
success = true;
}
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWFieldsWriter.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWFieldsWriter.cs
index a849aeb..25bdea9 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWFieldsWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWFieldsWriter.cs
@@ -81,7 +81,7 @@ namespace Lucene.Net.Codecs.Lucene3x
public override TermsConsumer AddField(FieldInfo field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field.Number != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field.Number != -1);
if (field.IndexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0)
{
throw new NotSupportedException("this codec cannot index offsets");
@@ -164,7 +164,7 @@ namespace Lucene.Net.Codecs.Lucene3x
lastDocID = docID;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docID < outerInstance.outerInstance.totalNumDocs, () => "docID=" + docID + " totalNumDocs=" + outerInstance.outerInstance.totalNumDocs);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docID < outerInstance.outerInstance.totalNumDocs, () => "docID=" + docID + " totalNumDocs=" + outerInstance.outerInstance.totalNumDocs);
if (outerInstance.omitTF)
{
@@ -188,9 +188,9 @@ namespace Lucene.Net.Codecs.Lucene3x
public override void AddPosition(int position, BytesRef payload, int startOffset, int endOffset)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => outerInstance.outerInstance.proxOut != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => startOffset == -1);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => endOffset == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(outerInstance.outerInstance.proxOut != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(startOffset == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(endOffset == -1);
//System.out.println(" w pos=" + position + " payl=" + payload);
int delta = position - lastPosition;
lastPosition = position;
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWNormsConsumer.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWNormsConsumer.cs
index 9cd2cde..0ff6703 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWNormsConsumer.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWNormsConsumer.cs
@@ -75,7 +75,7 @@ namespace Lucene.Net.Codecs.Lucene3x
public override void AddNumericField(FieldInfo field, IEnumerable<long?> values)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field.Number > lastFieldNumber, () => "writing norms fields out of order" + lastFieldNumber + " -> " + field.Number);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field.Number > lastFieldNumber, () => "writing norms fields out of order" + lastFieldNumber + " -> " + field.Number);
foreach (var n in values)
{
if (((sbyte)(byte)(long)n) < sbyte.MinValue || ((sbyte)(byte)(long)n) > sbyte.MaxValue)
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWStoredFieldsWriter.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWStoredFieldsWriter.cs
index 807b279..03f3a3d 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWStoredFieldsWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWStoredFieldsWriter.cs
@@ -36,7 +36,7 @@ namespace Lucene.Net.Codecs.Lucene3x
public PreFlexRWStoredFieldsWriter(Directory directory, string segment, IOContext context)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => directory != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(directory != null);
this.directory = directory;
this.segment = segment;
@@ -188,7 +188,7 @@ namespace Lucene.Net.Codecs.Lucene3x
fieldsStream.WriteInt64(J2N.BitConversion.DoubleToInt64Bits(field.GetDoubleValue().Value));
break;
default:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false);
break;
}
}
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWTermVectorsWriter.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWTermVectorsWriter.cs
index 1c42cd5..e08d332 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWTermVectorsWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWTermVectorsWriter.cs
@@ -75,7 +75,7 @@ namespace Lucene.Net.Codecs.Lucene3x
public override void StartField(FieldInfo info, int numTerms, bool positions, bool offsets, bool payloads)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => lastFieldName == null || info.Name.CompareToOrdinal(lastFieldName) > 0, () => "fieldName=" + info.Name + " lastFieldName=" + lastFieldName);
+ if (Debugging.AssertsEnabled) Debugging.Assert(lastFieldName == null || info.Name.CompareToOrdinal(lastFieldName) > 0, () => "fieldName=" + info.Name + " lastFieldName=" + lastFieldName);
lastFieldName = info.Name;
if (payloads)
{
@@ -98,7 +98,7 @@ namespace Lucene.Net.Codecs.Lucene3x
}
tvf.WriteByte((byte)bits);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldCount <= numVectorFields);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldCount <= numVectorFields);
if (fieldCount == numVectorFields)
{
// last field of the document
@@ -148,7 +148,7 @@ namespace Lucene.Net.Codecs.Lucene3x
public override void AddPosition(int position, int startOffset, int endOffset, BytesRef payload)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => payload == null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(payload == null);
if (positions && offsets)
{
// write position delta
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/TermInfosWriter.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/TermInfosWriter.cs
index 61d3b9e..8e33659 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/TermInfosWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/TermInfosWriter.cs
@@ -135,7 +135,7 @@ namespace Lucene.Net.Codecs.Lucene3x
output.WriteInt32(indexInterval); // write indexInterval
output.WriteInt32(skipInterval); // write skipInterval
output.WriteInt32(maxSkipLevels); // write maxSkipLevels
- if (Debugging.AssertsEnabled) Debugging.Assert(InitUTF16Results);
+ if (Debugging.AssertsEnabled) Debugging.Assert(InitUTF16Results());
success = true;
}
finally
@@ -202,10 +202,10 @@ namespace Lucene.Net.Codecs.Lucene3x
}
scratchBytes.CopyBytes(term);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => lastTerm.Offset == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(lastTerm.Offset == 0);
UnicodeUtil.UTF8toUTF16(lastTerm.Bytes, 0, lastTerm.Length, utf16Result1);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => scratchBytes.Offset == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(scratchBytes.Offset == 0);
UnicodeUtil.UTF8toUTF16(scratchBytes.Bytes, 0, scratchBytes.Length, utf16Result2);
int len;
@@ -243,10 +243,10 @@ namespace Lucene.Net.Codecs.Lucene3x
/// </summary>
public void Add(int fieldNumber, BytesRef term, TermInfo ti)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => CompareToLastTerm(fieldNumber, term) < 0 || (isIndex && term.Length == 0 && lastTerm.Length == 0), () => "Terms are out of order: field=" + FieldName(fieldInfos, fieldNumber) + " (number " + fieldNumber + ")" + " lastField=" + FieldName(fieldInfos, lastFieldNumber) + " (number " + lastFieldNumber + ")" + " text=" + term.Utf8ToString() + " lastText=" + lastTerm.Utf8ToString());
+ if (Debugging.AssertsEnabled) Debugging.Assert(CompareToLastTerm(fieldNumber, term) < 0 || (isIndex && term.Length == 0 && lastTerm.Length == 0), () => "Terms are out of order: field=" + FieldName(fieldInfos, fieldNumber) + " (number " + fieldNumber + ")" + " lastField=" + FieldName(fieldInfos, lastFieldNumber) + " (number " + lastFieldNumber + ")" + " text=" + term.Utf8ToString() + " lastText=" + lastTerm.Utf8ToString());
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ti.FreqPointer >= lastTi.FreqPointer, () => "freqPointer out of order (" + ti.FreqPointer + " < " + lastTi.FreqPointer + ")");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ti.ProxPointer >= lastTi.ProxPointer, () => "proxPointer out of order (" + ti.ProxPointer + " < " + lastTi.ProxPointer + ")");
+ if (Debugging.AssertsEnabled) Debugging.Assert(ti.FreqPointer >= lastTi.FreqPointer, () => "freqPointer out of order (" + ti.FreqPointer + " < " + lastTi.FreqPointer + ")");
+ if (Debugging.AssertsEnabled) Debugging.Assert(ti.ProxPointer >= lastTi.ProxPointer, () => "proxPointer out of order (" + ti.ProxPointer + " < " + lastTi.ProxPointer + ")");
if (!isIndex && size % indexInterval == 0)
{
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40DocValuesWriter.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40DocValuesWriter.cs
index 62d6dc1..ed4709d 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40DocValuesWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40DocValuesWriter.cs
@@ -333,7 +333,7 @@ namespace Lucene.Net.Codecs.Lucene40
index.WriteVInt64(maxAddress);
int maxDoc = state.SegmentInfo.DocCount;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => maxDoc != int.MaxValue); // unsupported by the 4.0 impl
+ if (Debugging.AssertsEnabled) Debugging.Assert(maxDoc != int.MaxValue); // unsupported by the 4.0 impl
PackedInt32s.Writer w = PackedInt32s.GetWriter(index, maxDoc + 1, PackedInt32s.BitsRequired(maxAddress), PackedInt32s.DEFAULT);
long currentPosition = 0;
@@ -346,7 +346,7 @@ namespace Lucene.Net.Codecs.Lucene40
}
}
// write sentinel
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentPosition == maxAddress);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentPosition == maxAddress);
w.Add(currentPosition);
w.Finish();
}
@@ -375,7 +375,7 @@ namespace Lucene.Net.Codecs.Lucene40
/* ordinals */
int valueCount = dictionary.Count;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valueCount > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(valueCount > 0);
index.WriteInt32(valueCount);
int maxDoc = state.SegmentInfo.DocCount;
PackedInt32s.Writer w = PackedInt32s.GetWriter(index, maxDoc, PackedInt32s.BitsRequired(valueCount - 1), PackedInt32s.DEFAULT);
@@ -439,7 +439,7 @@ namespace Lucene.Net.Codecs.Lucene40
// the little vint encoding used for var-deref
private static void WriteVInt16(IndexOutput o, int i)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => i >= 0 && i <= short.MaxValue);
+ if (Debugging.AssertsEnabled) Debugging.Assert(i >= 0 && i <= short.MaxValue);
if (i < 128)
{
o.WriteByte((byte)(sbyte)i);
@@ -545,7 +545,7 @@ namespace Lucene.Net.Codecs.Lucene40
index.WriteInt32(valueCount);
int maxDoc = state.SegmentInfo.DocCount;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valueCount > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(valueCount > 0);
PackedInt32s.Writer w = PackedInt32s.GetWriter(index, maxDoc, PackedInt32s.BitsRequired(valueCount - 1), PackedInt32s.DEFAULT);
foreach (long n in docToOrd)
{
@@ -578,7 +578,7 @@ namespace Lucene.Net.Codecs.Lucene40
long maxAddress = data.GetFilePointer() - startPos;
index.WriteInt64(maxAddress);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valueCount != int.MaxValue); // unsupported by the 4.0 impl
+ if (Debugging.AssertsEnabled) Debugging.Assert(valueCount != int.MaxValue); // unsupported by the 4.0 impl
PackedInt32s.Writer w = PackedInt32s.GetWriter(index, valueCount + 1, PackedInt32s.BitsRequired(maxAddress), PackedInt32s.DEFAULT);
long currentPosition = 0;
@@ -588,14 +588,14 @@ namespace Lucene.Net.Codecs.Lucene40
currentPosition += v.Length;
}
// write sentinel
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentPosition == maxAddress);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentPosition == maxAddress);
w.Add(currentPosition);
w.Finish();
/* ordinals */
int maxDoc = state.SegmentInfo.DocCount;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valueCount > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(valueCount > 0);
PackedInt32s.Writer ords = PackedInt32s.GetWriter(index, maxDoc, PackedInt32s.BitsRequired(valueCount - 1), PackedInt32s.DEFAULT);
foreach (long n in docToOrd)
{
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40FieldInfosWriter.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40FieldInfosWriter.cs
index d4eb855..3a13fac 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40FieldInfosWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40FieldInfosWriter.cs
@@ -66,7 +66,7 @@ namespace Lucene.Net.Codecs.Lucene40
if (fi.IsIndexed)
{
bits |= Lucene40FieldInfosFormat.IS_INDEXED;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0 || !fi.HasPayloads);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0 || !fi.HasPayloads);
if (indexOptions == IndexOptions.DOCS_ONLY)
{
bits |= Lucene40FieldInfosFormat.OMIT_TERM_FREQ_AND_POSITIONS;
@@ -87,7 +87,7 @@ namespace Lucene.Net.Codecs.Lucene40
// pack the DV types in one byte
byte dv = DocValuesByte(fi.DocValuesType, fi.GetAttribute(Lucene40FieldInfosReader.LEGACY_DV_TYPE_KEY));
byte nrm = DocValuesByte(fi.NormType, fi.GetAttribute(Lucene40FieldInfosReader.LEGACY_NORM_TYPE_KEY));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (dv & (~0xF)) == 0 && (nrm & (~0x0F)) == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert((dv & (~0xF)) == 0 && (nrm & (~0x0F)) == 0);
var val = (byte)(0xff & ((nrm << 4) | (byte)dv));
output.WriteByte(val);
output.WriteStringStringMap(fi.Attributes);
@@ -113,12 +113,12 @@ namespace Lucene.Net.Codecs.Lucene40
{
if (type == DocValuesType.NONE)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => legacyTypeAtt == null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(legacyTypeAtt == null);
return 0;
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => legacyTypeAtt != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(legacyTypeAtt != null);
//return (sbyte)LegacyDocValuesType.ordinalLookup[legacyTypeAtt];
return (byte)legacyTypeAtt.ToLegacyDocValuesType();
}
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40PostingsWriter.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40PostingsWriter.cs
index d5b8e24..8124e65 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40PostingsWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40PostingsWriter.cs
@@ -208,7 +208,7 @@ namespace Lucene.Net.Codecs.Lucene40
skipListWriter.BufferSkip(df);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docID < totalNumDocs, () => "docID=" + docID + " totalNumDocs=" + totalNumDocs);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docID < totalNumDocs, () => "docID=" + docID + " totalNumDocs=" + totalNumDocs);
lastDocID = docID;
if (indexOptions == IndexOptions.DOCS_ONLY)
@@ -234,12 +234,12 @@ namespace Lucene.Net.Codecs.Lucene40
public override void AddPosition(int position, BytesRef payload, int startOffset, int endOffset)
{
//if (DEBUG) System.out.println("SPW: addPos pos=" + position + " payload=" + (payload == null ? "null" : (payload.Length + " bytes")) + " proxFP=" + proxOut.getFilePointer());
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0, () => "invalid indexOptions: " + indexOptions);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => proxOut != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0, () => "invalid indexOptions: " + indexOptions);
+ if (Debugging.AssertsEnabled) Debugging.Assert(proxOut != null);
int delta = position - lastPosition;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => delta >= 0, () => "position=" + position + " lastPosition=" + lastPosition); // not quite right (if pos=0 is repeated twice we don't catch it)
+ if (Debugging.AssertsEnabled) Debugging.Assert(delta >= 0, () => "position=" + position + " lastPosition=" + lastPosition); // not quite right (if pos=0 is repeated twice we don't catch it)
lastPosition = position;
@@ -271,7 +271,7 @@ namespace Lucene.Net.Codecs.Lucene40
// and the numbers aren't that much smaller anyways.
int offsetDelta = startOffset - lastOffset;
int offsetLength = endOffset - startOffset;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => offsetDelta >= 0 && offsetLength >= 0, () => "startOffset=" + startOffset + ",lastOffset=" + lastOffset + ",endOffset=" + endOffset);
+ if (Debugging.AssertsEnabled) Debugging.Assert(offsetDelta >= 0 && offsetLength >= 0, () => "startOffset=" + startOffset + ",lastOffset=" + lastOffset + ",endOffset=" + endOffset);
if (offsetLength != lastOffsetLength)
{
proxOut.WriteVInt32(offsetDelta << 1 | 1);
@@ -308,11 +308,11 @@ namespace Lucene.Net.Codecs.Lucene40
{
StandardTermState state_ = (StandardTermState)state;
// if (DEBUG) System.out.println("SPW: finishTerm seg=" + segment + " freqStart=" + freqStart);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state_.DocFreq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state_.DocFreq > 0);
// TODO: wasteful we are counting this (counting # docs
// for this term) in two places?
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state_.DocFreq == df);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state_.DocFreq == df);
state_.FreqStart = freqStart;
state_.ProxStart = proxStart;
if (df >= skipMinimum)
@@ -337,7 +337,7 @@ namespace Lucene.Net.Codecs.Lucene40
@out.WriteVInt64(state_.FreqStart - lastState.FreqStart);
if (state_.SkipOffset != -1)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state_.SkipOffset > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state_.SkipOffset > 0);
@out.WriteVInt64(state_.SkipOffset);
}
if (indexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0)
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40SkipListWriter.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40SkipListWriter.cs
index d6ffba9..5b902a2 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40SkipListWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene40/Lucene40SkipListWriter.cs
@@ -67,8 +67,8 @@ namespace Lucene.Net.Codecs.Lucene40
/// </summary>
public virtual void SetSkipData(int doc, bool storePayloads, int payloadLength, bool storeOffsets, int offsetLength)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => storePayloads || payloadLength == -1);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => storeOffsets || offsetLength == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(storePayloads || payloadLength == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(storeOffsets || offsetLength == -1);
this.curDoc = doc;
this.curStorePayloads = storePayloads;
this.curPayloadLength = payloadLength;
@@ -120,8 +120,8 @@ namespace Lucene.Net.Codecs.Lucene40
if (curStorePayloads || curStoreOffsets)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => curStorePayloads || curPayloadLength == lastSkipPayloadLength[level]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => curStoreOffsets || curOffsetLength == lastSkipOffsetLength[level]);
+ if (Debugging.AssertsEnabled) Debugging.Assert(curStorePayloads || curPayloadLength == lastSkipPayloadLength[level]);
+ if (Debugging.AssertsEnabled) Debugging.Assert(curStoreOffsets || curOffsetLength == lastSkipOffsetLength[level]);
if (curPayloadLength == lastSkipPayloadLength[level] && curOffsetLength == lastSkipOffsetLength[level])
{
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene42/Lucene42DocValuesConsumer.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene42/Lucene42DocValuesConsumer.cs
index 6c5c200..fde6cbf 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene42/Lucene42DocValuesConsumer.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene42/Lucene42DocValuesConsumer.cs
@@ -125,7 +125,7 @@ namespace Lucene.Net.Codecs.Lucene42
++count;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => count == maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(count == maxDoc);
}
if (uniqueValues != null)
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene42/Lucene42FieldInfosWriter.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene42/Lucene42FieldInfosWriter.cs
index 11287be..f47d6c5 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene42/Lucene42FieldInfosWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene42/Lucene42FieldInfosWriter.cs
@@ -66,7 +66,7 @@ namespace Lucene.Net.Codecs.Lucene42
if (fi.IsIndexed)
{
bits |= Lucene42FieldInfosFormat.IS_INDEXED;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => indexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0 || !fi.HasPayloads);
+ if (Debugging.AssertsEnabled) Debugging.Assert(indexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0 || !fi.HasPayloads);
if (indexOptions == IndexOptions.DOCS_ONLY)
{
bits |= Lucene42FieldInfosFormat.OMIT_TERM_FREQ_AND_POSITIONS;
@@ -87,7 +87,7 @@ namespace Lucene.Net.Codecs.Lucene42
// pack the DV types in one byte
var dv = DocValuesByte(fi.DocValuesType);
var nrm = DocValuesByte(fi.NormType);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (dv & (~0xF)) == 0 && (nrm & (~0x0F)) == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert((dv & (~0xF)) == 0 && (nrm & (~0x0F)) == 0);
var val = (byte)(0xff & ((nrm << 4) | (byte)dv));
output.WriteByte(val);
output.WriteStringStringMap(fi.Attributes);
diff --git a/src/Lucene.Net.TestFramework/Codecs/MockIntBlock/MockVariableIntBlockPostingsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/MockIntBlock/MockVariableIntBlockPostingsFormat.cs
index 8734489..e484e59 100644
--- a/src/Lucene.Net.TestFramework/Codecs/MockIntBlock/MockVariableIntBlockPostingsFormat.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/MockIntBlock/MockVariableIntBlockPostingsFormat.cs
@@ -107,7 +107,7 @@ namespace Lucene.Net.Codecs.MockIntBlock
{
buffer[0] = input.ReadVInt32();
int count = buffer[0] <= 3 ? baseBlockSize - 1 : 2 * baseBlockSize - 1;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => buffer.Length >= count, () => "buffer.length=" + buffer.Length + " count=" + count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(buffer.Length >= count, () => "buffer.length=" + buffer.Length + " count=" + count);
for (int i = 0; i < count; i++)
{
buffer[i + 1] = input.ReadVInt32();
diff --git a/src/Lucene.Net.TestFramework/Codecs/MockRandom/MockRandomPostingsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/MockRandom/MockRandomPostingsFormat.cs
index 8481e0d..b4f7811 100644
--- a/src/Lucene.Net.TestFramework/Codecs/MockRandom/MockRandomPostingsFormat.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/MockRandom/MockRandomPostingsFormat.cs
@@ -88,7 +88,7 @@ namespace Lucene.Net.Codecs.MockRandom
private static string GetExtension(string fileName)
{
int idx = fileName.IndexOf('.');
- if (Debugging.AssertsEnabled) Debugging.Assert(() => idx != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(idx != -1);
return fileName.Substring(idx);
}
diff --git a/src/Lucene.Net.TestFramework/Codecs/RAMOnly/RAMOnlyPostingsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/RAMOnly/RAMOnlyPostingsFormat.cs
index ba4029e..f39a807 100644
--- a/src/Lucene.Net.TestFramework/Codecs/RAMOnly/RAMOnlyPostingsFormat.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/RAMOnly/RAMOnlyPostingsFormat.cs
@@ -290,8 +290,8 @@ namespace Lucene.Net.Codecs.RAMOnly
public override void FinishTerm(BytesRef text, TermStats stats)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stats.DocFreq > 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stats.DocFreq == current.docs.Count);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stats.DocFreq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stats.DocFreq == current.docs.Count);
current.totalTermFreq = stats.TotalTermFreq;
field.termToDocs[current.term] = current;
}
@@ -324,8 +324,8 @@ namespace Lucene.Net.Codecs.RAMOnly
public override void AddPosition(int position, BytesRef payload, int startOffset, int endOffset)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => startOffset == -1);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => endOffset == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(startOffset == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(endOffset == -1);
current.positions[posUpto] = position;
if (payload != null && payload.Length > 0)
{
@@ -341,7 +341,7 @@ namespace Lucene.Net.Codecs.RAMOnly
public override void FinishDoc()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => posUpto == current.positions.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(posUpto == current.positions.Length);
}
}
diff --git a/src/Lucene.Net.TestFramework/Index/AllDeletedFilterReader.cs b/src/Lucene.Net.TestFramework/Index/AllDeletedFilterReader.cs
index c545d60..9342369 100644
--- a/src/Lucene.Net.TestFramework/Index/AllDeletedFilterReader.cs
+++ b/src/Lucene.Net.TestFramework/Index/AllDeletedFilterReader.cs
@@ -31,7 +31,7 @@ namespace Lucene.Net.Index
: base(@in)
{
liveDocs = new Bits.MatchNoBits(@in.MaxDoc);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => MaxDoc == 0 || HasDeletions);
+ if (Debugging.AssertsEnabled) Debugging.Assert(MaxDoc == 0 || HasDeletions);
}
public override IBits LiveDocs => liveDocs;
diff --git a/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs b/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs
index 077b270..f36ddb8 100644
--- a/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs
+++ b/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs
@@ -36,7 +36,7 @@ namespace Lucene.Net.Index
public override IEnumerator<string> GetEnumerator()
{
IEnumerator<string> iterator = base.GetEnumerator();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => iterator != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(iterator != null);
return iterator;
}
@@ -59,8 +59,8 @@ namespace Lucene.Net.Index
public override TermsEnum Intersect(CompiledAutomaton automaton, BytesRef bytes)
{
TermsEnum termsEnum = m_input.Intersect(automaton, bytes);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termsEnum != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => bytes == null || bytes.IsValid());
+ if (Debugging.AssertsEnabled) Debugging.Assert(termsEnum != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(bytes == null || bytes.IsValid());
return new AssertingAtomicReader.AssertingTermsEnum(termsEnum);
}
@@ -73,7 +73,7 @@ namespace Lucene.Net.Index
reuse = ((AssertingAtomicReader.AssertingTermsEnum)reuse).m_input;
}
TermsEnum termsEnum = base.GetIterator(reuse);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termsEnum != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termsEnum != null);
return new AssertingAtomicReader.AssertingTermsEnum(termsEnum);
}
}
@@ -102,7 +102,7 @@ namespace Lucene.Net.Index
try
{
int docid = @in.DocID;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docid == -1, () => @in.GetType() + ": invalid initial doc id: " + docid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docid == -1, () => @in.GetType() + ": invalid initial doc id: " + docid);
}
catch (NotSupportedException /*e*/)
{
@@ -116,9 +116,9 @@ namespace Lucene.Net.Index
public override int NextDoc()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.FINISHED, () => "NextDoc() called after NO_MORE_DOCS");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.FINISHED, () => "NextDoc() called after NO_MORE_DOCS");
int nextDoc = base.NextDoc();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextDoc > doc, () => "backwards NextDoc from " + doc + " to " + nextDoc + " " + m_input);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextDoc > doc, () => "backwards NextDoc from " + doc + " to " + nextDoc + " " + m_input);
if (nextDoc == DocIdSetIterator.NO_MORE_DOCS)
{
state = DocsEnumState.FINISHED;
@@ -127,16 +127,16 @@ namespace Lucene.Net.Index
{
state = DocsEnumState.ITERATING;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => base.DocID == nextDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(base.DocID == nextDoc);
return doc = nextDoc;
}
public override int Advance(int target)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.FINISHED, () => "Advance() called after NO_MORE_DOCS");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => target > doc, () => "target must be > DocID, got " + target + " <= " + doc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.FINISHED, () => "Advance() called after NO_MORE_DOCS");
+ if (Debugging.AssertsEnabled) Debugging.Assert(target > doc, () => "target must be > DocID, got " + target + " <= " + doc);
int advanced = base.Advance(target);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => advanced >= target, () => "backwards advance from: " + target + " to: " + advanced);
+ if (Debugging.AssertsEnabled) Debugging.Assert(advanced >= target, () => "backwards advance from: " + target + " to: " + advanced);
if (advanced == DocIdSetIterator.NO_MORE_DOCS)
{
state = DocsEnumState.FINISHED;
@@ -145,7 +145,7 @@ namespace Lucene.Net.Index
{
state = DocsEnumState.ITERATING;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => base.DocID == advanced);
+ if (Debugging.AssertsEnabled) Debugging.Assert(base.DocID == advanced);
return doc = advanced;
}
@@ -153,7 +153,7 @@ namespace Lucene.Net.Index
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => doc == base.DocID, () => " invalid DocID in " + m_input.GetType() + " " + base.DocID + " instead of " + doc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(doc == base.DocID, () => " invalid DocID in " + m_input.GetType() + " " + base.DocID + " instead of " + doc);
return doc;
}
}
@@ -162,10 +162,10 @@ namespace Lucene.Net.Index
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.START, () => "Freq called before NextDoc()/Advance()");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.FINISHED, () => "Freq called after NO_MORE_DOCS");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.START, () => "Freq called before NextDoc()/Advance()");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.FINISHED, () => "Freq called after NO_MORE_DOCS");
int freq = base.Freq;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => freq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(freq > 0);
return freq;
}
}
@@ -186,7 +186,7 @@ namespace Lucene.Net.Index
public override long Get(int docID)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docID >= 0 && docID < maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docID >= 0 && docID < maxDoc);
return @in.Get(docID);
}
}
@@ -206,10 +206,10 @@ namespace Lucene.Net.Index
public override void Get(int docID, BytesRef result)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docID >= 0 && docID < maxDoc);
- if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docID >= 0 && docID < maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid());
@in.Get(docID, result);
- if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid());
}
}
@@ -226,23 +226,23 @@ namespace Lucene.Net.Index
this.@in = @in;
this.maxDoc = maxDoc;
this.valueCount = @in.ValueCount;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valueCount >= 0 && valueCount <= maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(valueCount >= 0 && valueCount <= maxDoc);
}
public override int GetOrd(int docID)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docID >= 0 && docID < maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docID >= 0 && docID < maxDoc);
int ord = @in.GetOrd(docID);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord >= -1 && ord < valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord >= -1 && ord < valueCount);
return ord;
}
public override void LookupOrd(int ord, BytesRef result)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord >= 0 && ord < valueCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord >= 0 && ord < valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid());
@in.LookupOrd(ord, result);
- if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid());
}
public override int ValueCount
@@ -250,25 +250,25 @@ namespace Lucene.Net.Index
get
{
int valueCount = @in.ValueCount;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valueCount == this.valueCount); // should not change
+ if (Debugging.AssertsEnabled) Debugging.Assert(valueCount == this.valueCount); // should not change
return valueCount;
}
}
public override void Get(int docID, BytesRef result)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docID >= 0 && docID < maxDoc);
- if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docID >= 0 && docID < maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid());
@in.Get(docID, result);
- if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid());
}
public override int LookupTerm(BytesRef key)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(key.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(key.IsValid());
int result = @in.LookupTerm(key);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => result < valueCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(key.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result < valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(key.IsValid());
return result;
}
}
@@ -287,32 +287,32 @@ namespace Lucene.Net.Index
this.@in = @in;
this.maxDoc = maxDoc;
this.valueCount = @in.ValueCount;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valueCount >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(valueCount >= 0);
}
public override long NextOrd()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => lastOrd != NO_MORE_ORDS);
+ if (Debugging.AssertsEnabled) Debugging.Assert(lastOrd != NO_MORE_ORDS);
long ord = @in.NextOrd();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord < valueCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord == NO_MORE_ORDS || ord > lastOrd);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord < valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord == NO_MORE_ORDS || ord > lastOrd);
lastOrd = ord;
return ord;
}
public override void SetDocument(int docID)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docID >= 0 && docID < maxDoc, () => "docid=" + docID + ",maxDoc=" + maxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docID >= 0 && docID < maxDoc, () => "docid=" + docID + ",maxDoc=" + maxDoc);
@in.SetDocument(docID);
lastOrd = -2;
}
public override void LookupOrd(long ord, BytesRef result)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord >= 0 && ord < valueCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord >= 0 && ord < valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid());
@in.LookupOrd(ord, result);
- if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid());
}
public override long ValueCount
@@ -320,17 +320,17 @@ namespace Lucene.Net.Index
get
{
long valueCount = @in.ValueCount;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => valueCount == this.valueCount); // should not change
+ if (Debugging.AssertsEnabled) Debugging.Assert(valueCount == this.valueCount); // should not change
return valueCount;
}
}
public override long LookupTerm(BytesRef key)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(key.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(key.IsValid());
long result = @in.LookupTerm(key);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => result < valueCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(key.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result < valueCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(key.IsValid());
return result;
}
}
@@ -348,7 +348,7 @@ namespace Lucene.Net.Index
public virtual bool Get(int index)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => index >= 0 && index < Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(index >= 0 && index < Length);
return @in.Get(index);
}
@@ -365,10 +365,10 @@ namespace Lucene.Net.Index
: base(@in)
{
// check some basic reader sanity
- if (Debugging.AssertsEnabled) Debugging.Assert(() => @in.MaxDoc >= 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => @in.NumDocs <= @in.MaxDoc);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => @in.NumDeletedDocs + @in.NumDocs == @in.MaxDoc);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !@in.HasDeletions || @in.NumDeletedDocs > 0 && @in.NumDocs < @in.MaxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(@in.MaxDoc >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(@in.NumDocs <= @in.MaxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(@in.NumDeletedDocs + @in.NumDocs == @in.MaxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!@in.HasDeletions || @in.NumDeletedDocs > 0 && @in.NumDocs < @in.MaxDoc);
}
public override Fields Fields
@@ -409,7 +409,7 @@ namespace Lucene.Net.Index
public override DocsEnum Docs(IBits liveDocs, DocsEnum reuse, DocsFlags flags)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == State.POSITIONED, () => "Docs(...) called on unpositioned TermsEnum");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == State.POSITIONED, () => "Docs(...) called on unpositioned TermsEnum");
// TODO: should we give this thing a random to be super-evil,
// and randomly *not* unwrap?
@@ -423,7 +423,7 @@ namespace Lucene.Net.Index
public override DocsAndPositionsEnum DocsAndPositions(IBits liveDocs, DocsAndPositionsEnum reuse, DocsAndPositionsFlags flags)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == State.POSITIONED, () => "DocsAndPositions(...) called on unpositioned TermsEnum");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == State.POSITIONED, () => "DocsAndPositions(...) called on unpositioned TermsEnum");
// TODO: should we give this thing a random to be super-evil,
// and randomly *not* unwrap?
@@ -439,7 +439,7 @@ namespace Lucene.Net.Index
// someone should not call next() after it returns null!!!!
public override BytesRef Next()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == State.INITIAL || state == State.POSITIONED, () => "Next() called on unpositioned TermsEnum");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == State.INITIAL || state == State.POSITIONED, () => "Next() called on unpositioned TermsEnum");
BytesRef result = base.Next();
if (result == null)
{
@@ -447,7 +447,7 @@ namespace Lucene.Net.Index
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result.IsValid());
state = State.POSITIONED;
}
return result;
@@ -457,7 +457,7 @@ namespace Lucene.Net.Index
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == State.POSITIONED, () => "Ord called on unpositioned TermsEnum");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == State.POSITIONED, () => "Ord called on unpositioned TermsEnum");
return base.Ord;
}
}
@@ -466,7 +466,7 @@ namespace Lucene.Net.Index
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == State.POSITIONED, () => "DocFreq called on unpositioned TermsEnum");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == State.POSITIONED, () => "DocFreq called on unpositioned TermsEnum");
return base.DocFreq;
}
}
@@ -475,7 +475,7 @@ namespace Lucene.Net.Index
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == State.POSITIONED, () => "TotalTermFreq called on unpositioned TermsEnum");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == State.POSITIONED, () => "TotalTermFreq called on unpositioned TermsEnum");
return base.TotalTermFreq;
}
}
@@ -484,9 +484,9 @@ namespace Lucene.Net.Index
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == State.POSITIONED, () => "Term called on unpositioned TermsEnum");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == State.POSITIONED, () => "Term called on unpositioned TermsEnum");
BytesRef ret = base.Term;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ret == null || ret.IsValid());
+ if (Debugging.AssertsEnabled) Debugging.Assert(ret == null || ret.IsValid());
return ret;
}
}
@@ -499,7 +499,7 @@ namespace Lucene.Net.Index
public override SeekStatus SeekCeil(BytesRef term)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(term.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(term.IsValid());
SeekStatus result = base.SeekCeil(term);
if (result == SeekStatus.END)
{
@@ -514,7 +514,7 @@ namespace Lucene.Net.Index
public override bool SeekExact(BytesRef text)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(text.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(text.IsValid());
if (base.SeekExact(text))
{
state = State.POSITIONED;
@@ -529,13 +529,13 @@ namespace Lucene.Net.Index
public override TermState GetTermState()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state == State.POSITIONED, () => "GetTermState() called on unpositioned TermsEnum");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state == State.POSITIONED, () => "GetTermState() called on unpositioned TermsEnum");
return base.GetTermState();
}
public override void SeekExact(BytesRef term, TermState state)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(term.IsValid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(term.IsValid());
base.SeekExact(term, state);
this.state = State.POSITIONED;
}
@@ -556,15 +556,15 @@ namespace Lucene.Net.Index
: base(@in)
{
int docid = @in.DocID;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docid == -1, () => "invalid initial doc id: " + docid);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docid == -1, () => "invalid initial doc id: " + docid);
doc = -1;
}
public override int NextDoc()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.FINISHED, () => "NextDoc() called after NO_MORE_DOCS");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.FINISHED, () => "NextDoc() called after NO_MORE_DOCS");
int nextDoc = base.NextDoc();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextDoc > doc, () => "backwards nextDoc from " + doc + " to " + nextDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextDoc > doc, () => "backwards nextDoc from " + doc + " to " + nextDoc);
positionCount = 0;
if (nextDoc == DocIdSetIterator.NO_MORE_DOCS)
{
@@ -576,16 +576,16 @@ namespace Lucene.Net.Index
state = DocsEnumState.ITERATING;
positionMax = base.Freq;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => base.DocID == nextDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(base.DocID == nextDoc);
return doc = nextDoc;
}
public override int Advance(int target)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.FINISHED, () => "Advance() called after NO_MORE_DOCS");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => target > doc, () => "target must be > DocID, got " + target + " <= " + doc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.FINISHED, () => "Advance() called after NO_MORE_DOCS");
+ if (Debugging.AssertsEnabled) Debugging.Assert(target > doc, () => "target must be > DocID, got " + target + " <= " + doc);
int advanced = base.Advance(target);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => advanced >= target, () => "backwards advance from: " + target + " to: " + advanced);
+ if (Debugging.AssertsEnabled) Debugging.Assert(advanced >= target, () => "backwards advance from: " + target + " to: " + advanced);
positionCount = 0;
if (advanced == DocIdSetIterator.NO_MORE_DOCS)
{
@@ -597,7 +597,7 @@ namespace Lucene.Net.Index
state = DocsEnumState.ITERATING;
positionMax = base.Freq;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => base.DocID == advanced);
+ if (Debugging.AssertsEnabled) Debugging.Assert(base.DocID == advanced);
return doc = advanced;
}
@@ -605,7 +605,7 @@ namespace Lucene.Net.Index
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => doc == base.DocID, () => " invalid DocID in " + m_input.GetType() + " " + base.DocID + " instead of " + doc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(doc == base.DocID, () => " invalid DocID in " + m_input.GetType() + " " + base.DocID + " instead of " + doc);
return doc;
}
}
@@ -614,21 +614,21 @@ namespace Lucene.Net.Index
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.START, () => "Freq called before NextDoc()/Advance()");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.FINISHED, () => "Freq called after NO_MORE_DOCS");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.START, () => "Freq called before NextDoc()/Advance()");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.FINISHED, () => "Freq called after NO_MORE_DOCS");
int freq = base.Freq;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => freq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(freq > 0);
return freq;
}
}
public override int NextPosition()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.START, () => "NextPosition() called before NextDoc()/Advance()");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.FINISHED, () => "NextPosition() called after NO_MORE_DOCS");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => positionCount < positionMax, () => "NextPosition() called more than Freq times!");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.START, () => "NextPosition() called before NextDoc()/Advance()");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.FINISHED, () => "NextPosition() called after NO_MORE_DOCS");
+ if (Debugging.AssertsEnabled) Debugging.Assert(positionCount < positionMax, () => "NextPosition() called more than Freq times!");
int position = base.NextPosition();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => position >= 0 || position == -1, () => "invalid position: " + position);
+ if (Debugging.AssertsEnabled) Debugging.Assert(position >= 0 || position == -1, () => "invalid position: " + position);
positionCount++;
return position;
}
@@ -637,9 +637,9 @@ namespace Lucene.Net.Index
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.START, () => "StartOffset called before NextDoc()/Advance()");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.FINISHED, () => "StartOffset called after NO_MORE_DOCS");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => positionCount > 0, () => "StartOffset called before NextPosition()!");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.START, () => "StartOffset called before NextDoc()/Advance()");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.FINISHED, () => "StartOffset called after NO_MORE_DOCS");
+ if (Debugging.AssertsEnabled) Debugging.Assert(positionCount > 0, () => "StartOffset called before NextPosition()!");
return base.StartOffset;
}
}
@@ -648,20 +648,20 @@ namespace Lucene.Net.Index
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.START, () => "EndOffset called before NextDoc()/Advance()");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.FINISHED, () => "EndOffset called after NO_MORE_DOCS");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => positionCount > 0, () => "EndOffset called before NextPosition()!");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.START, () => "EndOffset called before NextDoc()/Advance()");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.FINISHED, () => "EndOffset called after NO_MORE_DOCS");
+ if (Debugging.AssertsEnabled) Debugging.Assert(positionCount > 0, () => "EndOffset called before NextPosition()!");
return base.EndOffset;
}
}
public override BytesRef GetPayload()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.START, () => "GetPayload() called before NextDoc()/Advance()");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != DocsEnumState.FINISHED, () => "GetPayload() called after NO_MORE_DOCS");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => positionCount > 0, () => "GetPayload() called before NextPosition()!");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.START, () => "GetPayload() called before NextDoc()/Advance()");
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != DocsEnumState.FINISHED, () => "GetPayload() called after NO_MORE_DOCS");
+ if (Debugging.AssertsEnabled) Debugging.Assert(positionCount > 0, () => "GetPayload() called before NextPosition()!");
BytesRef payload = base.GetPayload();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => payload == null || payload.IsValid() && payload.Length > 0, () => "GetPayload() returned payload with invalid length!");
+ if (Debugging.AssertsEnabled) Debugging.Assert(payload == null || payload.IsValid() && payload.Length > 0, () => "GetPayload() returned payload with invalid length!");
return payload;
}
}
@@ -681,13 +681,13 @@ namespace Lucene.Net.Index
FieldInfo fi = FieldInfos.FieldInfo(field);
if (dv != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi.DocValuesType == DocValuesType.NUMERIC);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi.DocValuesType == DocValuesType.NUMERIC);
return new AssertingNumericDocValues(dv, MaxDoc);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi == null || fi.DocValuesType != DocValuesType.NUMERIC);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi == null || fi.DocValuesType != DocValuesType.NUMERIC);
return null;
}
}
@@ -698,13 +698,13 @@ namespace Lucene.Net.Index
FieldInfo fi = FieldInfos.FieldInfo(field);
if (dv != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi.DocValuesType == DocValuesType.BINARY);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi.DocValuesType == DocValuesType.BINARY);
return new AssertingBinaryDocValues(dv, MaxDoc);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi == null || fi.DocValuesType != DocValuesType.BINARY);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi == null || fi.DocValuesType != DocValuesType.BINARY);
return null;
}
}
@@ -715,13 +715,13 @@ namespace Lucene.Net.Index
FieldInfo fi = FieldInfos.FieldInfo(field);
if (dv != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi.DocValuesType == DocValuesType.SORTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi.DocValuesType == DocValuesType.SORTED);
return new AssertingSortedDocValues(dv, MaxDoc);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi == null || fi.DocValuesType != DocValuesType.SORTED);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi == null || fi.DocValuesType != DocValuesType.SORTED);
return null;
}
}
@@ -732,13 +732,13 @@ namespace Lucene.Net.Index
FieldInfo fi = FieldInfos.FieldInfo(field);
if (dv != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi.DocValuesType == DocValuesType.SORTED_SET);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi.DocValuesType == DocValuesType.SORTED_SET);
return new AssertingSortedSetDocValues(dv, MaxDoc);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi == null || fi.DocValuesType != DocValuesType.SORTED_SET);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi == null || fi.DocValuesType != DocValuesType.SORTED_SET);
return null;
}
}
@@ -749,13 +749,13 @@ namespace Lucene.Net.Index
FieldInfo fi = FieldInfos.FieldInfo(field);
if (dv != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi.HasNorms);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi.HasNorms);
return new AssertingNumericDocValues(dv, MaxDoc);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi == null || fi.HasNorms == false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi == null || fi.HasNorms == false);
return null;
}
}
@@ -769,13 +769,13 @@ namespace Lucene.Net.Index
IBits liveDocs = base.LiveDocs;
if (liveDocs != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => MaxDoc == liveDocs.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(MaxDoc == liveDocs.Length);
liveDocs = new AssertingBits(liveDocs);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => MaxDoc == NumDocs);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !HasDeletions);
+ if (Debugging.AssertsEnabled) Debugging.Assert(MaxDoc == NumDocs);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!HasDeletions);
}
return liveDocs;
}
@@ -787,14 +787,14 @@ namespace Lucene.Net.Index
FieldInfo fi = FieldInfos.FieldInfo(field);
if (docsWithField != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi.HasDocValues);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => MaxDoc == docsWithField.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi.HasDocValues);
+ if (Debugging.AssertsEnabled) Debugging.Assert(MaxDoc == docsWithField.Length);
docsWithField = new AssertingBits(docsWithField);
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fi == null || fi.HasDocValues == false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fi == null || fi.HasDocValues == false);
}
return docsWithField;
}
diff --git a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
index e0ab0ac..4e65680 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
@@ -116,7 +116,7 @@ namespace Lucene.Net.Index
{
Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
Assert.AreEqual(text, hitDoc.Get("fieldname"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
NumericDocValues dv = ((AtomicReader)((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader))).GetNumericDocValues("dv");
Assert.AreEqual(5L, dv.Get(hits.ScoreDocs[i].Doc)); // LUCENENET specific - 5L required because types don't match (xUnit checks this)
}
@@ -159,7 +159,7 @@ namespace Lucene.Net.Index
{
Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
Assert.AreEqual(text, hitDoc.Get("fieldname"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
NumericDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetNumericDocValues("dv");
Assert.AreEqual((long)J2N.BitConversion.SingleToInt32Bits(5.7f), dv.Get(hits.ScoreDocs[i].Doc)); // LUCENENET specific - cast required because types don't match (xUnit checks this)
}
@@ -201,7 +201,7 @@ namespace Lucene.Net.Index
{
Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
Assert.AreEqual(text, hitDoc.Get("fieldname"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
NumericDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetNumericDocValues("dv1");
Assert.AreEqual(5L, dv.Get(hits.ScoreDocs[i].Doc)); // LUCENENET specific - 5L required because types don't match (xUnit checks this)
dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetNumericDocValues("dv2");
@@ -248,7 +248,7 @@ namespace Lucene.Net.Index
{
Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
Assert.AreEqual(text, hitDoc.Get("fieldname"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetBinaryDocValues("dv1");
dv.Get(hits.ScoreDocs[i].Doc, scratch);
Assert.AreEqual(new BytesRef(longTerm), scratch);
@@ -297,7 +297,7 @@ namespace Lucene.Net.Index
{
Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
Assert.AreEqual(text, hitDoc.Get("fieldname"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
NumericDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetNumericDocValues("dv1");
Assert.AreEqual(5L, dv.Get(hits.ScoreDocs[i].Doc)); // LUCENENET specific - 5L required because types don't match (xUnit checks this)
BinaryDocValues dv2 = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetBinaryDocValues("dv2");
@@ -346,7 +346,7 @@ namespace Lucene.Net.Index
{
Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
Assert.AreEqual(text, hitDoc.Get("fieldname"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv1");
int ord = dv.GetOrd(0);
dv.LookupOrd(ord, scratch);
@@ -399,7 +399,7 @@ namespace Lucene.Net.Index
{
Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
Assert.AreEqual(text, hitDoc.Get("fieldname"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv2");
int ord = dv.GetOrd(0);
dv.LookupOrd(ord, scratch);
@@ -438,7 +438,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
NumericDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv");
Assert.AreEqual(1L, dv.Get(0)); // LUCENENET specific - 1L required because types don't match (xUnit checks this)
Assert.AreEqual(2L, dv.Get(1)); // LUCENENET specific - 2L required because types don't match (xUnit checks this)
@@ -473,7 +473,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
NumericDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv");
for (int i = 0; i < 2; i++)
{
@@ -517,7 +517,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
NumericDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv");
Assert.AreEqual(long.MinValue, dv.Get(0));
Assert.AreEqual(long.MaxValue, dv.Get(1));
@@ -549,7 +549,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
NumericDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv");
Assert.AreEqual(-8841491950446638677L, dv.Get(0));
Assert.AreEqual(9062230939892376225L, dv.Get(1));
@@ -591,7 +591,7 @@ namespace Lucene.Net.Index
{
Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
Assert.AreEqual(text, hitDoc.Get("fieldname"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
dv.Get(hits.ScoreDocs[i].Doc, scratch);
Assert.AreEqual(new BytesRef("hello world"), scratch);
@@ -627,7 +627,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
BytesRef scratch = new BytesRef();
for (int i = 0; i < 2; i++)
@@ -684,7 +684,7 @@ namespace Lucene.Net.Index
{
Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
Assert.AreEqual(text, hitDoc.Get("fieldname"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
dv.LookupOrd(dv.GetOrd(hits.ScoreDocs[i].Doc), scratch);
Assert.AreEqual(new BytesRef("hello world"), scratch);
@@ -717,7 +717,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
BytesRef scratch = new BytesRef();
dv.LookupOrd(dv.GetOrd(0), scratch);
@@ -755,7 +755,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
Assert.AreEqual(2, dv.ValueCount);
BytesRef scratch = new BytesRef();
@@ -797,7 +797,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
Assert.AreEqual(2, dv.ValueCount); // 2 ords
BytesRef scratch = new BytesRef();
@@ -894,7 +894,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
BytesRef scratch = new BytesRef();
dv.Get(0, scratch);
@@ -925,7 +925,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
BytesRef scratch = new BytesRef();
dv.LookupOrd(dv.GetOrd(0), scratch);
@@ -1045,7 +1045,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
BytesRef scratch = new BytesRef();
Assert.AreEqual(0, dv.GetOrd(0));
@@ -1080,7 +1080,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
BytesRef scratch = new BytesRef();
dv.Get(0, scratch);
@@ -1114,7 +1114,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
BytesRef scratch = new BytesRef();
dv.Get(0, scratch);
@@ -1146,7 +1146,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
BytesRef scratch = new BytesRef();
dv.Get(0, scratch);
@@ -1174,7 +1174,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
var mybytes = new byte[20];
BytesRef scratch = new BytesRef(mybytes);
@@ -1205,7 +1205,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
var mybytes = new byte[20];
BytesRef scratch = new BytesRef(mybytes);
@@ -1239,7 +1239,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
BytesRef scratch = new BytesRef();
dv.Get(0, scratch);
@@ -1277,7 +1277,7 @@ namespace Lucene.Net.Index
// Now search the index:
using (IndexReader ireader = DirectoryReader.Open(directory)) // read-only=true
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
BytesRef scratch = new BytesRef();
dv.Get(0, scratch);
@@ -1494,7 +1494,7 @@ namespace Lucene.Net.Index
int numDocs = AtLeast(300);
// numDocs should be always > 256 so that in case of a codec that optimizes
// for numbers of values <= 256, all storage layouts are tested
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numDocs > 256);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numDocs > 256);
for (int i = 0; i < numDocs; i++)
{
idField.SetStringValue(Convert.ToString(i, CultureInfo.InvariantCulture));
@@ -1580,7 +1580,7 @@ namespace Lucene.Net.Index
int numDocs = AtLeast(300);
// numDocs should be always > 256 so that in case of a codec that optimizes
// for numbers of values <= 256, all storage layouts are tested
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numDocs > 256);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numDocs > 256);
for (int i = 0; i < numDocs; i++)
{
idField.SetStringValue(Convert.ToString(i, CultureInfo.InvariantCulture));
@@ -2649,13 +2649,13 @@ namespace Lucene.Net.Index
}
for (int j = 0; j < stringValues.Length; j++)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docValues != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docValues != null);
long ord = docValues.NextOrd();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord != SortedSetDocValues.NO_MORE_ORDS);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord != SortedSetDocValues.NO_MORE_ORDS);
docValues.LookupOrd(ord, scratch);
Assert.AreEqual(stringValues[j], scratch.Utf8ToString());
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docValues == null || docValues.NextOrd() == SortedSetDocValues.NO_MORE_ORDS);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docValues == null || docValues.NextOrd() == SortedSetDocValues.NO_MORE_ORDS);
}
}
} // ir.Dispose();
diff --git a/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
index 7498cfe..45e2392 100644
--- a/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
@@ -239,7 +239,7 @@ namespace Lucene.Net.Index
posUpto = freq;
return 0;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => posUpto < freq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(posUpto < freq);
if (posUpto == 0 && random.NextBoolean())
{
diff --git a/src/Lucene.Net.TestFramework/Index/MockRandomMergePolicy.cs b/src/Lucene.Net.TestFramework/Index/MockRandomMergePolicy.cs
index 528d0c9..f4e0675 100644
--- a/src/Lucene.Net.TestFramework/Index/MockRandomMergePolicy.cs
+++ b/src/Lucene.Net.TestFramework/Index/MockRandomMergePolicy.cs
@@ -106,7 +106,7 @@ namespace Lucene.Net.Index
{
foreach (SegmentCommitInfo info in merge.Segments)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => segmentsToMerge.ContainsKey(info));
+ if (Debugging.AssertsEnabled) Debugging.Assert(segmentsToMerge.ContainsKey(info));
}
}
}
diff --git a/src/Lucene.Net.TestFramework/Index/RandomCodec.cs b/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
index 2b0436f..74da42e 100644
--- a/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
+++ b/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
@@ -92,7 +92,7 @@ namespace Lucene.Net.Index
}
previousMappings[name] = codec;
// Safety:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => previousMappings.Count < 10000, () => "test went insane");
+ if (Debugging.AssertsEnabled) Debugging.Assert(previousMappings.Count < 10000, () => "test went insane");
}
//if (LuceneTestCase.VERBOSE)
@@ -115,7 +115,7 @@ namespace Lucene.Net.Index
}
previousDVMappings[name] = codec;
// Safety:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => previousDVMappings.Count < 10000, () => "test went insane");
+ if (Debugging.AssertsEnabled) Debugging.Assert(previousDVMappings.Count < 10000, () => "test went insane");
}
//if (LuceneTestCase.VERBOSE)
diff --git a/src/Lucene.Net.TestFramework/Index/RandomDocumentsWriterPerThreadPool.cs b/src/Lucene.Net.TestFramework/Index/RandomDocumentsWriterPerThreadPool.cs
index 52faf55..fc82ddb 100644
--- a/src/Lucene.Net.TestFramework/Index/RandomDocumentsWriterPerThreadPool.cs
+++ b/src/Lucene.Net.TestFramework/Index/RandomDocumentsWriterPerThreadPool.cs
@@ -36,7 +36,7 @@ namespace Lucene.Net.Index
public RandomDocumentsWriterPerThreadPool(int maxNumPerThreads, Random random)
: base(maxNumPerThreads)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => MaxThreadStates >= 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(MaxThreadStates >= 1);
states = new ThreadState[maxNumPerThreads];
this.random = new Random(random.Next());
this.maxRetry = 1 + random.Next(10);
@@ -56,14 +56,14 @@ namespace Lucene.Net.Index
}
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => NumThreadStatesActive > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(NumThreadStatesActive > 0);
for (int i = 0; i < maxRetry; i++)
{
int ord = random.Next(NumThreadStatesActive);
lock (this)
{
threadState = states[ord];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => threadState != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(threadState != null);
}
if (threadState.TryLock())
@@ -94,7 +94,7 @@ namespace Lucene.Net.Index
}
// if no new state is available lock the random one
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => threadState != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(threadState != null);
threadState.@Lock();
return threadState;
}
diff --git a/src/Lucene.Net.TestFramework/Index/RandomIndexWriter.cs b/src/Lucene.Net.TestFramework/Index/RandomIndexWriter.cs
index 91a368e..1506033 100644
--- a/src/Lucene.Net.TestFramework/Index/RandomIndexWriter.cs
+++ b/src/Lucene.Net.TestFramework/Index/RandomIndexWriter.cs
@@ -440,7 +440,7 @@ namespace Lucene.Net.Index
Console.WriteLine("RIW: doRandomForceMerge(" + limit + ")");
}
IndexWriter.ForceMerge(limit);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !doRandomForceMergeAssert || IndexWriter.SegmentCount <= limit, () => "limit=" + limit + " actual=" + IndexWriter.SegmentCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!doRandomForceMergeAssert || IndexWriter.SegmentCount <= limit, () => "limit=" + limit + " actual=" + IndexWriter.SegmentCount);
}
}
}
diff --git a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
index 176882c..f872bc5 100644
--- a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
@@ -227,7 +227,7 @@ namespace Lucene.Net.Index
if (toDeleteSubDocs.Count > 0 && Random.NextBoolean())
{
delSubDocs = toDeleteSubDocs[Random.Next(toDeleteSubDocs.Count)];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !delSubDocs.Deleted);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!delSubDocs.Deleted);
toDeleteSubDocs.Remove(delSubDocs);
// Update doc block, replacing prior packID
packID = delSubDocs.PackID;
@@ -364,7 +364,7 @@ namespace Lucene.Net.Index
foreach (SubDocs subDocs in toDeleteSubDocs)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !subDocs.Deleted);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!subDocs.Deleted);
delPackIDs.Add(subDocs.PackID);
outerInstance.DeleteDocuments(new Term("packID", subDocs.PackID));
subDocs.Deleted = true;
diff --git a/src/Lucene.Net.TestFramework/Search/AssertingBulkScorer.cs b/src/Lucene.Net.TestFramework/Search/AssertingBulkScorer.cs
index c3de506..4f7057c 100644
--- a/src/Lucene.Net.TestFramework/Search/AssertingBulkScorer.cs
+++ b/src/Lucene.Net.TestFramework/Search/AssertingBulkScorer.cs
@@ -61,7 +61,7 @@ namespace Lucene.Net.Search
try
{
bool remaining = @in.Score(collector, DocsEnum.NO_MORE_DOCS);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !remaining);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!remaining);
}
#pragma warning disable 168
catch (NotSupportedException e)
diff --git a/src/Lucene.Net.TestFramework/Search/AssertingCollector.cs b/src/Lucene.Net.TestFramework/Search/AssertingCollector.cs
index f183d86..c57819c 100644
--- a/src/Lucene.Net.TestFramework/Search/AssertingCollector.cs
+++ b/src/Lucene.Net.TestFramework/Search/AssertingCollector.cs
@@ -52,7 +52,7 @@ namespace Lucene.Net.Search
{
if (inOrder || !AcceptsDocsOutOfOrder)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => doc > lastCollected, () => "Out of order : " + lastCollected + " " + doc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(doc > lastCollected, () => "Out of order : " + lastCollected + " " + doc);
}
@in.Collect(doc);
lastCollected = doc;
diff --git a/src/Lucene.Net.TestFramework/Search/AssertingScorer.cs b/src/Lucene.Net.TestFramework/Search/AssertingScorer.cs
index ed7ae45..3dc951a 100644
--- a/src/Lucene.Net.TestFramework/Search/AssertingScorer.cs
+++ b/src/Lucene.Net.TestFramework/Search/AssertingScorer.cs
@@ -105,10 +105,10 @@ namespace Lucene.Net.Search
public override float GetScore()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(Iterating);
+ if (Debugging.AssertsEnabled) Debugging.Assert(Iterating());
float score = @in.GetScore();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !float.IsNaN(score));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !float.IsNaN(score));
+ if (Debugging.AssertsEnabled) Debugging.Assert(!float.IsNaN(score));
+ if (Debugging.AssertsEnabled) Debugging.Assert(!float.IsNaN(score));
return score;
}
@@ -125,7 +125,7 @@ namespace Lucene.Net.Search
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(Iterating);
+ if (Debugging.AssertsEnabled) Debugging.Assert(Iterating());
return @in.Freq;
}
}
diff --git a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
index 8f046f8..7331687 100644
--- a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
+++ b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
@@ -294,7 +294,7 @@ namespace Lucene.Net.Search
private static IndexReader MakeEmptyIndex(Random random, int numDocs)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numDocs > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numDocs > 0);
Directory d = new MockDirectoryWrapper(random, new RAMDirectory());
IndexWriter w = new IndexWriter(d, new IndexWriterConfig(LuceneTestCase.TEST_VERSION_CURRENT, new MockAnalyzer(random)));
for (int i = 0; i < numDocs; i++)
@@ -487,7 +487,7 @@ namespace Lucene.Net.Search
leafPtr++;
}
lastReader[0] = (AtomicReader)context.Reader;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => readerContextArray[leafPtr].Reader == context.Reader);
+ if (Debugging.AssertsEnabled) Debugging.Assert(readerContextArray[leafPtr].Reader == context.Reader);
this.scorer = null;
lastDoc[0] = -1;
}
diff --git a/src/Lucene.Net.TestFramework/Search/RandomSimilarityProvider.cs b/src/Lucene.Net.TestFramework/Search/RandomSimilarityProvider.cs
index 811bcb7..e7f0b9e 100644
--- a/src/Lucene.Net.TestFramework/Search/RandomSimilarityProvider.cs
+++ b/src/Lucene.Net.TestFramework/Search/RandomSimilarityProvider.cs
@@ -71,7 +71,7 @@ namespace Lucene.Net.Search
{
lock (this)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field != null);
if (!previousMappings.TryGetValue(field, out Similarity sim) || sim == null)
{
sim = knownSims[Math.Max(0, Math.Abs(perFieldSeed ^ field.GetHashCode())) % knownSims.Count];
diff --git a/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs b/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
index 78f47d9..67d887b 100644
--- a/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
+++ b/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
@@ -220,7 +220,7 @@ namespace Lucene.Net.Search
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => searchAfter == null); // not supported yet
+ if (Debugging.AssertsEnabled) Debugging.Assert(searchAfter == null); // not supported yet
return s.LocalSearch(q, numHits, sort);
}
}
@@ -306,7 +306,7 @@ namespace Lucene.Net.Search
this.outerInstance = nodeState;
this.nodeVersions = nodeVersions;
MyNodeID = nodeID;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => MyNodeID == nodeState.MyNodeID, () => "myNodeID=" + nodeID + " NodeState.this.myNodeID=" + nodeState.MyNodeID);
+ if (Debugging.AssertsEnabled) Debugging.Assert(MyNodeID == nodeState.MyNodeID, () => "myNodeID=" + nodeID + " NodeState.this.myNodeID=" + nodeState.MyNodeID);
}
public override Query Rewrite(Query original)
@@ -348,7 +348,7 @@ namespace Lucene.Net.Search
public override TermStatistics TermStatistics(Term term, TermContext context)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => term != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(term != null);
long docFreq = 0;
long totalTermFreq = 0;
for (int nodeID = 0; nodeID < nodeVersions.Length; nodeID++)
@@ -364,7 +364,7 @@ namespace Lucene.Net.Search
subStats = outerInstance.termStatsCache[key];
// We pre-cached during rewrite so all terms
// better be here...
- if (Debugging.AssertsEnabled) Debugging.Assert(() => subStats != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(subStats != null);
}
long nodeDocFreq = subStats.DocFreq;
@@ -419,7 +419,7 @@ namespace Lucene.Net.Search
}
// Collection stats are pre-shared on reopen, so,
// we better not have a cache miss:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nodeStats != null, () => "myNodeID=" + MyNodeID + " nodeID=" + nodeID + " version=" + nodeVersions[nodeID] + " field=" + field);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nodeStats != null, () => "myNodeID=" + MyNodeID + " nodeID=" + nodeID + " version=" + nodeVersions[nodeID] + " field=" + field);
long nodeDocCount = nodeStats.DocCount;
if (docCount >= 0 && nodeDocCount >= 0)
@@ -451,7 +451,7 @@ namespace Lucene.Net.Search
sumDocFreq = -1;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nodeStats.MaxDoc >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nodeStats.MaxDoc >= 0);
maxDoc += nodeStats.MaxDoc;
}
@@ -551,7 +551,7 @@ namespace Lucene.Net.Search
public override TopFieldDocs Search(Query query, int numHits, Sort sort)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sort != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sort != null);
TopDocs[] shardHits = new TopDocs[nodeVersions.Length];
for (int nodeID = 0; nodeID < nodeVersions.Length; nodeID++)
{
@@ -604,7 +604,7 @@ namespace Lucene.Net.Search
public void InitSearcher(long[] nodeVersions)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentShardSearcher == null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentShardSearcher == null);
Array.Copy(nodeVersions, 0, currentNodeVersions, 0, currentNodeVersions.Length);
currentShardSearcher = new ShardIndexSearcher(this, GetCurrentNodeVersions(), Mgr.Acquire().IndexReader, MyNodeID);
}
@@ -781,8 +781,8 @@ namespace Lucene.Net.Search
for (int nodeID = 0; nodeID < numNodes; nodeID++)
{
IndexSearcher s = m_nodes[nodeID].Mgr.Acquire();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nodeVersions[nodeID] == m_nodes[nodeID].Searchers.Record(s));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => s != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nodeVersions[nodeID] == m_nodes[nodeID].Searchers.Record(s));
+ if (Debugging.AssertsEnabled) Debugging.Assert(s != null);
try
{
BroadcastNodeReopen(nodeID, nodeVersions[nodeID], s);
diff --git a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
index 60aa77d..7428971 100644
--- a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
+++ b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
@@ -963,7 +963,7 @@ namespace Lucene.Net.Store
{
if (endSet.Contains(s) && !startSet.Contains(s))
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pendingDeletions.Contains(s));
+ if (Debugging.AssertsEnabled) Debugging.Assert(pendingDeletions.Contains(s));
if (LuceneTestCase.Verbose)
{
Console.WriteLine("MDW: Unreferenced check: Ignoring referenced file: " + s + " " +
@@ -1024,7 +1024,7 @@ namespace Lucene.Net.Store
extras += "\n\nThese files we had previously tried to delete, but couldn't: " + pendingDeletions;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "unreferenced files: before delete:\n " + Arrays.ToString(startFiles) + "\n after delete:\n " + Arrays.ToString(endFiles) + extras);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "unreferenced files: before delete:\n " + Arrays.ToString(startFiles) + "\n after delete:\n " + Arrays.ToString(endFiles) + extras);
}
DirectoryReader ir1 = DirectoryReader.Open(this);
@@ -1034,7 +1034,7 @@ namespace Lucene.Net.Store
DirectoryReader ir2 = DirectoryReader.Open(this);
int numDocs2 = ir2.NumDocs;
ir2.Dispose();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numDocs1 == numDocs2, () => "numDocs changed after opening/closing IW: before=" + numDocs1 + " after=" + numDocs2);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numDocs1 == numDocs2, () => "numDocs changed after opening/closing IW: before=" + numDocs1 + " after=" + numDocs2);
}
}
}
diff --git a/src/Lucene.Net.TestFramework/Support/JavaCompatibility/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Support/JavaCompatibility/LuceneTestCase.cs
index 3d9ea80..d2c7955 100644
--- a/src/Lucene.Net.TestFramework/Support/JavaCompatibility/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Support/JavaCompatibility/LuceneTestCase.cs
@@ -259,7 +259,7 @@ namespace Lucene.Net.Util
[ExceptionToNetNumericConvention] // LUCENENET: This is for making test porting easier, keeping as-is
internal int randomIntBetween(int min, int max)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => max >= min, () => "max must be >= min: " + min + ", " + max);
+ if (Debugging.AssertsEnabled) Debugging.Assert(max >= min, () => "max must be >= min: " + min + ", " + max);
long range = (long)max - (long)min;
if (range < int.MaxValue)
{
diff --git a/src/Lucene.Net.TestFramework/Util/Automaton/AutomatonTestUtil.cs b/src/Lucene.Net.TestFramework/Util/Automaton/AutomatonTestUtil.cs
index 52e6904..fa40f16 100644
--- a/src/Lucene.Net.TestFramework/Util/Automaton/AutomatonTestUtil.cs
+++ b/src/Lucene.Net.TestFramework/Util/Automaton/AutomatonTestUtil.cs
@@ -191,7 +191,7 @@ namespace Lucene.Net.Util.Automaton
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => code >= t.Min && code <= t.Max && (code < UnicodeUtil.UNI_SUR_HIGH_START || code > UnicodeUtil.UNI_SUR_LOW_END), () => "code=" + code + " min=" + t.Min + " max=" + t.Max);
+ if (Debugging.AssertsEnabled) Debugging.Assert(code >= t.Min && code <= t.Max && (code < UnicodeUtil.UNI_SUR_HIGH_START || code > UnicodeUtil.UNI_SUR_LOW_END), () => "code=" + code + " min=" + t.Min + " max=" + t.Max);
return code;
}
@@ -399,7 +399,7 @@ namespace Lucene.Net.Util.Automaton
{
int numStates = a.GetNumberOfStates();
a.ClearNumberedStates(); // force recomputation of cached numbered states
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numStates == a.GetNumberOfStates(), () => "automaton has " + (numStates - a.GetNumberOfStates()) + " detached states");
+ if (Debugging.AssertsEnabled) Debugging.Assert(numStates == a.GetNumberOfStates(), () => "automaton has " + (numStates - a.GetNumberOfStates()) + " detached states");
}
}
diff --git a/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs b/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs
index 1c74e96..430cce7 100644
--- a/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs
@@ -56,7 +56,7 @@ namespace Lucene.Net.Util
/// Create a random set which has <paramref name="numBitsSet"/> of its <paramref name="numBits"/> bits set. </summary>
protected static BitSet RandomSet(int numBits, int numBitsSet)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numBitsSet <= numBits);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numBitsSet <= numBits);
BitSet set = new BitSet(numBits);
Random random = Random;
if (numBitsSet == numBits)
diff --git a/src/Lucene.Net.TestFramework/Util/FailOnNonBulkMergesInfoStream.cs b/src/Lucene.Net.TestFramework/Util/FailOnNonBulkMergesInfoStream.cs
index e573e12..7fdfb90 100644
--- a/src/Lucene.Net.TestFramework/Util/FailOnNonBulkMergesInfoStream.cs
+++ b/src/Lucene.Net.TestFramework/Util/FailOnNonBulkMergesInfoStream.cs
@@ -35,7 +35,7 @@ namespace Lucene.Net.Util
public override void Message(string component, string message)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !message.Contains("non-bulk merges"));
+ if (Debugging.AssertsEnabled) Debugging.Assert(!message.Contains("non-bulk merges"));
}
}
}
\ No newline at end of file
diff --git a/src/Lucene.Net.TestFramework/Util/Fst/FSTTester.cs b/src/Lucene.Net.TestFramework/Util/Fst/FSTTester.cs
index 875dc69..94898c2 100644
--- a/src/Lucene.Net.TestFramework/Util/Fst/FSTTester.cs
+++ b/src/Lucene.Net.TestFramework/Util/Fst/FSTTester.cs
@@ -103,7 +103,7 @@ namespace Lucene.Net.Util.Fst
for (int i = 0; i < ir.Length; i++)
{
int x = ir.Int32s[ir.Offset + i];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => x >= 0 && x <= 255);
+ if (Debugging.AssertsEnabled) Debugging.Assert(x >= 0 && x <= 255);
br.Bytes[i] = (byte)x;
}
br.Length = ir.Length;
@@ -219,7 +219,7 @@ namespace Lucene.Net.Util.Fst
// of the term prefix that matches
private T Run(FST<T> fst, Int32sRef term, int[] prefixLength)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => prefixLength == null || prefixLength.Length == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(prefixLength == null || prefixLength.Length == 1);
FST.Arc<T> arc = fst.GetFirstArc(new FST.Arc<T>());
T NO_OUTPUT = fst.Outputs.NoOutput;
T output = NO_OUTPUT;
@@ -690,7 +690,7 @@ namespace Lucene.Net.Util.Fst
if (!termsMap.ContainsKey(term) && term.CompareTo(pairs[upto].Input) > 0)
{
int pos = pairs.BinarySearch(new InputOutput<T>(term, default(T)));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pos < 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pos < 0);
upto = -(pos + 1);
if (random.NextBoolean())
@@ -887,7 +887,7 @@ namespace Lucene.Net.Util.Fst
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => prune2 > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(prune2 > 0);
if (prune2 > 1 && cmo.Count >= prune2)
{
keep = true;
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index bf79a35..6460cbd 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -2678,7 +2678,7 @@ namespace Lucene.Net.Util
/// </summary>
public virtual void AssertTermsStatisticsEquals(string info, Terms leftTerms, Terms rightTerms)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => leftTerms.Comparer == rightTerms.Comparer);
+ if (Debugging.AssertsEnabled) Debugging.Assert(leftTerms.Comparer == rightTerms.Comparer);
if (leftTerms.DocCount != -1 && rightTerms.DocCount != -1)
{
Assert.AreEqual(leftTerms.DocCount, rightTerms.DocCount, info);
@@ -3053,7 +3053,7 @@ namespace Lucene.Net.Util
/// </summary>
public virtual void AssertStoredFieldsEquals(string info, IndexReader leftReader, IndexReader rightReader)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => leftReader.MaxDoc == rightReader.MaxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(leftReader.MaxDoc == rightReader.MaxDoc);
for (int i = 0; i < leftReader.MaxDoc; i++)
{
Document leftDoc = leftReader.Document(i);
@@ -3100,7 +3100,7 @@ namespace Lucene.Net.Util
/// </summary>
public virtual void AssertTermVectorsEquals(string info, IndexReader leftReader, IndexReader rightReader)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => leftReader.MaxDoc == rightReader.MaxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(leftReader.MaxDoc == rightReader.MaxDoc);
for (int i = 0; i < leftReader.MaxDoc; i++)
{
Fields leftFields = leftReader.GetTermVectors(i);
@@ -3270,7 +3270,7 @@ namespace Lucene.Net.Util
// TODO: this is kinda stupid, we don't delete documents in the test.
public virtual void AssertDeletedDocsEquals(string info, IndexReader leftReader, IndexReader rightReader)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => leftReader.NumDeletedDocs == rightReader.NumDeletedDocs);
+ if (Debugging.AssertsEnabled) Debugging.Assert(leftReader.NumDeletedDocs == rightReader.NumDeletedDocs);
IBits leftBits = MultiFields.GetLiveDocs(leftReader);
IBits rightBits = MultiFields.GetLiveDocs(rightReader);
@@ -3281,7 +3281,7 @@ namespace Lucene.Net.Util
return;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => leftReader.MaxDoc == rightReader.MaxDoc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(leftReader.MaxDoc == rightReader.MaxDoc);
Assert.AreEqual(leftBits.Length, rightBits.Length, info);
for (int i = 0; i < leftReader.MaxDoc; i++)
{
@@ -3365,7 +3365,7 @@ namespace Lucene.Net.Util
//// if (TempDirBase == null)
//// {
//// DirectoryInfo directory = new DirectoryInfo(System.IO.Path.GetTempPath());
- //// //if (Debugging.AssertsEnabled) Debugging.Assert(() => directory.Exists && directory.Directory != null && directory.CanWrite());
+ //// //if (Debugging.AssertsEnabled) Debugging.Assert(directory.Exists && directory.Directory != null && directory.CanWrite());
//// RandomizedContext ctx = RandomizedContext.Current;
//// Type clazz = ctx.GetTargetType;
@@ -3504,7 +3504,7 @@ namespace Lucene.Net.Util
/// </summary>
private static void RegisterToRemoveAfterSuite(FileSystemInfo f)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => f != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(f != null);
if (LuceneTestCase.LeaveTemporary)
{
diff --git a/src/Lucene.Net.TestFramework/Util/NullInfoStream.cs b/src/Lucene.Net.TestFramework/Util/NullInfoStream.cs
index eafb5f2..315bfb4 100644
--- a/src/Lucene.Net.TestFramework/Util/NullInfoStream.cs
+++ b/src/Lucene.Net.TestFramework/Util/NullInfoStream.cs
@@ -29,13 +29,13 @@ namespace Lucene.Net.Util
{
public override void Message(string component, string message)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => component != null);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => message != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(component != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(message != null);
}
public override bool IsEnabled(string component)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => component != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(component != null);
return true; // to actually enable logging, we just ignore on message()
}
diff --git a/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs b/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
index f32b343..a0ca6d2 100644
--- a/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
+++ b/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
@@ -169,7 +169,7 @@ namespace Lucene.Net.Util
!ShouldAvoidCodec("Lucene3x"))) // preflex-only setup
{
codec = Codec.ForName("Lucene3x");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (codec is PreFlexRWCodec), () => "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
+ if (Debugging.AssertsEnabled) Debugging.Assert((codec is PreFlexRWCodec), () => "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
LuceneTestCase.OldFormatImpersonationIsActive = true;
}
else if ("Lucene40".Equals(LuceneTestCase.TestCodec, StringComparison.Ordinal) || ("random".Equals(LuceneTestCase.TestCodec, StringComparison.Ordinal) &&
@@ -179,8 +179,8 @@ namespace Lucene.Net.Util
{
codec = Codec.ForName("Lucene40");
LuceneTestCase.OldFormatImpersonationIsActive = true;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (codec is Lucene40RWCodec), () => "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (PostingsFormat.ForName("Lucene40") is Lucene40RWPostingsFormat), () => "fix your IPostingsFormatFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
+ if (Debugging.AssertsEnabled) Debugging.Assert((codec is Lucene40RWCodec), () => "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
+ if (Debugging.AssertsEnabled) Debugging.Assert((PostingsFormat.ForName("Lucene40") is Lucene40RWPostingsFormat), () => "fix your IPostingsFormatFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
}
else if ("Lucene41".Equals(LuceneTestCase.TestCodec, StringComparison.Ordinal) || ("random".Equals(LuceneTestCase.TestCodec, StringComparison.Ordinal) &&
"random".Equals(LuceneTestCase.TestPostingsFormat, StringComparison.Ordinal) &&
@@ -190,7 +190,7 @@ namespace Lucene.Net.Util
{
codec = Codec.ForName("Lucene41");
LuceneTestCase.OldFormatImpersonationIsActive = true;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (codec is Lucene41RWCodec), () => "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
+ if (Debugging.AssertsEnabled) Debugging.Assert((codec is Lucene41RWCodec), () => "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
}
else if ("Lucene42".Equals(LuceneTestCase.TestCodec, StringComparison.Ordinal) || ("random".Equals(LuceneTestCase.TestCodec, StringComparison.Ordinal) &&
"random".Equals(LuceneTestCase.TestPostingsFormat, StringComparison.Ordinal) &&
@@ -200,7 +200,7 @@ namespace Lucene.Net.Util
{
codec = Codec.ForName("Lucene42");
LuceneTestCase.OldFormatImpersonationIsActive = true;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (codec is Lucene42RWCodec), () => "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
+ if (Debugging.AssertsEnabled) Debugging.Assert((codec is Lucene42RWCodec), () => "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
}
else if ("Lucene45".Equals(LuceneTestCase.TestCodec, StringComparison.Ordinal) || ("random".Equals(LuceneTestCase.TestCodec, StringComparison.Ordinal) &&
"random".Equals(LuceneTestCase.TestPostingsFormat, StringComparison.Ordinal) &&
@@ -210,7 +210,7 @@ namespace Lucene.Net.Util
{
codec = Codec.ForName("Lucene45");
LuceneTestCase.OldFormatImpersonationIsActive = true;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (codec is Lucene45RWCodec), () => "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
+ if (Debugging.AssertsEnabled) Debugging.Assert((codec is Lucene45RWCodec), () => "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
}
else if (("random".Equals(LuceneTestCase.TestPostingsFormat, StringComparison.Ordinal) == false)
|| ("random".Equals(LuceneTestCase.TestDocValuesFormat, StringComparison.Ordinal) == false))
@@ -275,7 +275,7 @@ namespace Lucene.Net.Util
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false);
}
Codec.Default = codec;
diff --git a/src/Lucene.Net.TestFramework/Util/ThrottledIndexOutput.cs b/src/Lucene.Net.TestFramework/Util/ThrottledIndexOutput.cs
index 9730e3f..738c444 100644
--- a/src/Lucene.Net.TestFramework/Util/ThrottledIndexOutput.cs
+++ b/src/Lucene.Net.TestFramework/Util/ThrottledIndexOutput.cs
@@ -61,7 +61,7 @@ namespace Lucene.Net.Util
public ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput @delegate)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => bytesPerSecond > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(bytesPerSecond > 0);
this.@delegate = @delegate;
this.bytesPerSecond = bytesPerSecond;
this.flushDelayMillis = flushDelayMillis;
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/CharFilters/TestMappingCharFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/CharFilters/TestMappingCharFilter.cs
index f0b5623..2daf82a 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/CharFilters/TestMappingCharFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/CharFilters/TestMappingCharFilter.cs
@@ -422,7 +422,7 @@ namespace Lucene.Net.Analysis.CharFilters
// Same length: no change to offset
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => inputOffsets.Count == output.Length, () => "inputOffsets.size()=" + inputOffsets.Count + " vs output.length()=" + output.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(inputOffsets.Count == output.Length, () => "inputOffsets.size()=" + inputOffsets.Count + " vs output.length()=" + output.Length);
}
else
{
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestFactories.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestFactories.cs
index 6333c35..13b2cf3 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestFactories.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestFactories.cs
@@ -211,7 +211,7 @@ namespace Lucene.Net.Analysis.Core
internal FactoryAnalyzer(TokenizerFactory tokenizer, TokenFilterFactory tokenfilter, CharFilterFactory charFilter)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => tokenizer != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(tokenizer != null);
this.tokenizer = tokenizer;
this.charFilter = charFilter;
this.tokenfilter = tokenfilter;
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs
index 20ea9ce..0dce8c7 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs
@@ -172,7 +172,7 @@ namespace Lucene.Net.Analysis.Core
public virtual bool Apply(object[] args)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => args.Length == 3);
+ if (Debugging.AssertsEnabled) Debugging.Assert(args.Length == 3);
return !((bool)args[2]); // args are broken if consumeAllTokens is false
}
}
@@ -185,7 +185,7 @@ namespace Lucene.Net.Analysis.Core
public virtual bool Apply(object[] args)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => args.Length == 3);
+ if (Debugging.AssertsEnabled) Debugging.Assert(args.Length == 3);
return !((bool)args[2]); // args are broken if consumeAllTokens is false
}
}
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs
index 48f9ea8..c10147a 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs
@@ -168,16 +168,16 @@ namespace Lucene.Net.Analysis.Hunspell
for (int i = 0; i < tests.Length; i += 3)
{
FileInfo f = new FileInfo(System.IO.Path.Combine(DICTIONARY_HOME.FullName, tests[i]));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => f.Exists);
+ if (Debugging.AssertsEnabled) Debugging.Assert(f.Exists);
using (Stream fileStream = f.OpenRead())
{
using (ZipArchive zip = new ZipArchive(fileStream, ZipArchiveMode.Read, false, Encoding.UTF8))
{
ZipArchiveEntry dicEntry = zip.GetEntry(tests[i + 1]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => dicEntry != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(dicEntry != null);
ZipArchiveEntry affEntry = zip.GetEntry(tests[i + 2]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => affEntry != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(affEntry != null);
using (Stream dictionary = dicEntry.Open())
{
@@ -208,16 +208,16 @@ namespace Lucene.Net.Analysis.Hunspell
if (tests[i].Equals(toTest, StringComparison.Ordinal))
{
FileInfo f = new FileInfo(System.IO.Path.Combine(DICTIONARY_HOME.FullName, tests[i]));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => f.Exists);
+ if (Debugging.AssertsEnabled) Debugging.Assert(f.Exists);
using (Stream fileStream = f.OpenRead())
{
using (ZipArchive zip = new ZipArchive(fileStream, ZipArchiveMode.Read, false, Encoding.UTF8))
{
ZipArchiveEntry dicEntry = zip.GetEntry(tests[i + 1]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => dicEntry != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(dicEntry != null);
ZipArchiveEntry affEntry = zip.GetEntry(tests[i + 2]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => affEntry != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(affEntry != null);
using (Stream dictionary = dicEntry.Open())
{
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs
index cce39a6..a1ac6b5 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs
@@ -184,16 +184,16 @@ namespace Lucene.Net.Analysis.Hunspell
for (int i = 0; i < tests.Length; i += 3)
{
FileInfo f = new FileInfo(System.IO.Path.Combine(DICTIONARY_HOME.FullName, tests[i]));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => f.Exists);
+ if (Debugging.AssertsEnabled) Debugging.Assert(f.Exists);
using (Stream fileStream = f.OpenRead())
{
using (ZipArchive zip = new ZipArchive(fileStream, ZipArchiveMode.Read, false, Encoding.UTF8))
{
ZipArchiveEntry dicEntry = zip.GetEntry(tests[i + 1]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => dicEntry != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(dicEntry != null);
ZipArchiveEntry affEntry = zip.GetEntry(tests[i + 2]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => affEntry != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(affEntry != null);
using (Stream dictionary = dicEntry.Open())
{
@@ -226,16 +226,16 @@ namespace Lucene.Net.Analysis.Hunspell
if (tests[i].Equals(toTest, StringComparison.Ordinal))
{
FileInfo f = new FileInfo(System.IO.Path.Combine(DICTIONARY_HOME.FullName, tests[i]));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => f.Exists);
+ if (Debugging.AssertsEnabled) Debugging.Assert(f.Exists);
using (Stream fileStream = f.OpenRead())
{
using (ZipArchive zip = new ZipArchive(fileStream, ZipArchiveMode.Read, false, Encoding.UTF8))
{
ZipArchiveEntry dicEntry = zip.GetEntry(tests[i + 1]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => dicEntry != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(dicEntry != null);
ZipArchiveEntry affEntry = zip.GetEntry(tests[i + 2]);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => affEntry != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(affEntry != null);
using (Stream dictionary = dicEntry.Open())
{
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
index 44f4ad2..ba8d1de 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
@@ -268,7 +268,7 @@ namespace Lucene.Net.Analysis.Synonym
private string GetRandomString(char start, int alphabetSize, int length)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => alphabetSize <= 26);
+ if (Debugging.AssertsEnabled) Debugging.Assert(alphabetSize <= 26);
char[] s = new char[2 * length];
for (int charIDX = 0; charIDX < length; charIDX++)
{
diff --git a/src/Lucene.Net.Tests.Facet/FacetTestCase.cs b/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
index 5c1afbf..b0d4a31 100644
--- a/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
+++ b/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
@@ -154,7 +154,7 @@ namespace Lucene.Net.Facet
if (numInRow > 1)
{
Array.Sort(labelValues, i - numInRow, i - (i - numInRow), Comparer<LabelAndValue>.Create((a,b)=> {
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (double)a.Value == (double)b.Value);
+ if (Debugging.AssertsEnabled) Debugging.Assert((double)a.Value == (double)b.Value);
return (new BytesRef(a.Label)).CompareTo(new BytesRef(b.Label));
}));
}
diff --git a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
index a9d27ab..537dada 100644
--- a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
+++ b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
@@ -1197,7 +1197,7 @@ namespace Lucene.Net.Facet.Range
protected override Facets BuildFacetsResult(FacetsCollector drillDowns, FacetsCollector[] drillSideways, string[] drillSidewaysDims)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => drillSideways.Length == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(drillSideways.Length == 1);
return new DoubleRangeFacetCounts("field", vs, drillSideways[0], fastMatchFilter, ranges);
}
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
index 09c2ed7..2e95b28 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
@@ -385,7 +385,7 @@ namespace Lucene.Net.Facet.Taxonomy
public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
{
Scorer scorer = (Scorer)context["scorer"];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => scorer != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(scorer != null);
return new DoubleDocValuesAnonymousInnerClassHelper(this, scorer);
}
diff --git a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
index d89256a..97be3a1 100644
--- a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
+++ b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
@@ -866,7 +866,7 @@ namespace Lucene.Net.Facet
public virtual void Collect(int doc)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => doc > lastDocID);
+ if (Debugging.AssertsEnabled) Debugging.Assert(doc > lastDocID);
lastDocID = doc;
}
@@ -948,8 +948,8 @@ namespace Lucene.Net.Facet
public virtual void Inc(int[] dims, int[] dims2, int onlyDim)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => dims.Length == counts.Length);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => dims2.Length == counts.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(dims.Length == counts.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(dims2.Length == counts.Length);
for (int dim = 0; dim < dims.Length; dim++)
{
if (onlyDim == -1 || dim == onlyDim)
diff --git a/src/Lucene.Net.Tests.Grouping/GroupFacetCollectorTest.cs b/src/Lucene.Net.Tests.Grouping/GroupFacetCollectorTest.cs
index 3329b69..07d085c 100644
--- a/src/Lucene.Net.Tests.Grouping/GroupFacetCollectorTest.cs
+++ b/src/Lucene.Net.Tests.Grouping/GroupFacetCollectorTest.cs
@@ -559,7 +559,7 @@ namespace Lucene.Net.Search.Grouping
Field[] facetFields;
if (useDv)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !multipleFacetValuesPerDocument);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!multipleFacetValuesPerDocument);
facetFields = new Field[2];
facetFields[0] = NewStringField("facet", "", Field.Store.NO);
doc.Add(facetFields[0]);
@@ -816,7 +816,7 @@ namespace Lucene.Net.Search.Grouping
{
BytesRef facetPrefixBR = facetPrefix == null ? null : new BytesRef(facetPrefix);
// DocValues cannot be multi-valued:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !multipleFacetsPerDocument || !groupField.EndsWith("_dv", StringComparison.Ordinal));
+ if (Debugging.AssertsEnabled) Debugging.Assert(!multipleFacetsPerDocument || !groupField.EndsWith("_dv", StringComparison.Ordinal));
return TermGroupFacetCollector.CreateTermGroupFacetCollector(groupField, facetField, multipleFacetsPerDocument, facetPrefixBR, Random.nextInt(1024));
}
diff --git a/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs b/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
index 99189a1..8228ecc 100644
--- a/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
+++ b/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
@@ -775,8 +775,8 @@ namespace Lucene.Net.Search.PostingsHighlight
protected override IList<string[]> LoadFieldValues(IndexSearcher searcher, string[] fields, int[] docids, int maxLength)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fields.Length == 1);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docids.Length == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fields.Length == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docids.Length == 1);
String[][] contents = RectangularArrays.ReturnRectangularArray<string>(1, 1); //= new String[1][1];
contents[0][0] = text;
return contents;
@@ -1179,7 +1179,7 @@ namespace Lucene.Net.Search.PostingsHighlight
{
protected override char GetMultiValuedSeparator(string field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field.Equals("body", StringComparison.Ordinal));
+ if (Debugging.AssertsEnabled) Debugging.Assert(field.Equals("body", StringComparison.Ordinal));
return '\u2029';
}
}
diff --git a/src/Lucene.Net.Tests.Join/TestJoinUtil.cs b/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
index 09ea77f..59de865 100644
--- a/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
+++ b/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
@@ -1030,7 +1030,7 @@ namespace Lucene.Net.Tests.Join
{
DocsEnum docsEnum = MultiFields.GetTermDocsEnum(topLevelReader,
MultiFields.GetLiveDocs(topLevelReader), "id", new BytesRef(otherSideDoc.id), 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docsEnum != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docsEnum != null);
int doc = docsEnum.NextDoc();
expectedResult.Set(doc);
}
diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
index 32a1bce..f8417b7 100644
--- a/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
@@ -65,8 +65,8 @@ namespace Lucene.Net.QueryParsers.Classic
public override Query GetQuery(string query, ICommonQueryParserConfiguration cqpC)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC != null, () => "Parameter must not be null");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC is QueryParser, () => "Parameter must be instance of QueryParser");
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC != null, () => "Parameter must not be null");
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC is QueryParser, () => "Parameter must be instance of QueryParser");
QueryParser qp = (QueryParser)cqpC;
return qp.Parse(query);
}
@@ -83,35 +83,35 @@ namespace Lucene.Net.QueryParsers.Classic
public override void SetDefaultOperatorOR(ICommonQueryParserConfiguration cqpC)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC is QueryParser);
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC is QueryParser);
QueryParser qp = (QueryParser)cqpC;
qp.DefaultOperator = Operator.OR;
}
public override void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC is QueryParser);
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC is QueryParser);
QueryParser qp = (QueryParser)cqpC;
qp.DefaultOperator = Operator.AND;
}
public override void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC, bool value)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC is QueryParser);
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC is QueryParser);
QueryParser qp = (QueryParser)cqpC;
qp.AnalyzeRangeTerms = (value);
}
public override void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC, bool value)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC is QueryParser);
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC is QueryParser);
QueryParser qp = (QueryParser)cqpC;
qp.AutoGeneratePhraseQueries = value;
}
public override void SetDateResolution(ICommonQueryParserConfiguration cqpC, string field, DateTools.Resolution value)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC is QueryParser);
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC is QueryParser);
QueryParser qp = (QueryParser)cqpC;
qp.SetDateResolution(field, value);
}
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestStandardQP.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestStandardQP.cs
index f9d2855..5cdeb98 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestStandardQP.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestStandardQP.cs
@@ -59,8 +59,8 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
public override Query GetQuery(String query, ICommonQueryParserConfiguration cqpC)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC != null, () => "Parameter must not be null");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => (cqpC is StandardQueryParser), () => "Parameter must be instance of StandardQueryParser");
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC != null, () => "Parameter must not be null");
+ if (Debugging.AssertsEnabled) Debugging.Assert((cqpC is StandardQueryParser), () => "Parameter must be instance of StandardQueryParser");
StandardQueryParser qp = (StandardQueryParser)cqpC;
return Parse(query, qp);
}
@@ -80,7 +80,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
public override void SetDefaultOperatorOR(ICommonQueryParserConfiguration cqpC)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC is StandardQueryParser);
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC is StandardQueryParser);
StandardQueryParser qp = (StandardQueryParser)cqpC;
qp.DefaultOperator = (Operator.OR);
}
@@ -88,7 +88,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
public override void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC is StandardQueryParser);
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC is StandardQueryParser);
StandardQueryParser qp = (StandardQueryParser)cqpC;
qp.DefaultOperator = (Operator.AND);
}
@@ -111,7 +111,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
public override void SetDateResolution(ICommonQueryParserConfiguration cqpC,
string field, DateTools.Resolution value)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => cqpC is StandardQueryParser);
+ if (Debugging.AssertsEnabled) Debugging.Assert(cqpC is StandardQueryParser);
StandardQueryParser qp = (StandardQueryParser)cqpC;
qp.DateResolutionMap.Put(field, value);
}
diff --git a/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyReplicationClientTest.cs b/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyReplicationClientTest.cs
index a6fe124..38f8c2f 100644
--- a/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyReplicationClientTest.cs
+++ b/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyReplicationClientTest.cs
@@ -461,7 +461,7 @@ namespace Lucene.Net.Replicator
{
// count-down number of failures
failures.DecrementAndGet();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => failures >= 0, () => "handler failed too many times: " + failures);
+ if (Debugging.AssertsEnabled) Debugging.Assert(failures >= 0, () => "handler failed too many times: " + failures);
if (Verbose)
{
if (failures == 0)
diff --git a/src/Lucene.Net.Tests.Replicator/IndexReplicationClientTest.cs b/src/Lucene.Net.Tests.Replicator/IndexReplicationClientTest.cs
index ee05bc1..f4dfbb1 100644
--- a/src/Lucene.Net.Tests.Replicator/IndexReplicationClientTest.cs
+++ b/src/Lucene.Net.Tests.Replicator/IndexReplicationClientTest.cs
@@ -367,7 +367,7 @@ namespace Lucene.Net.Replicator
{
// count-down number of failures
failures.DecrementAndGet();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => failures >= 0, () => "handler failed too many times: " + failures);
+ if (Debugging.AssertsEnabled) Debugging.Assert(failures >= 0, () => "handler failed too many times: " + failures);
if (Verbose)
{
if (failures == 0)
diff --git a/src/Lucene.Net.Tests.Spatial/SpatialTestCase.cs b/src/Lucene.Net.Tests.Spatial/SpatialTestCase.cs
index 6f54dd4..eb64791 100644
--- a/src/Lucene.Net.Tests.Spatial/SpatialTestCase.cs
+++ b/src/Lucene.Net.Tests.Spatial/SpatialTestCase.cs
@@ -152,7 +152,7 @@ namespace Lucene.Net.Spatial
private double randomGaussianMinMeanMax(double min, double mean, double max)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => mean > min);
+ if (Debugging.AssertsEnabled) Debugging.Assert(mean > min);
return randomGaussianMeanMax(mean - min, max - min) + min;
}
@@ -166,7 +166,7 @@ namespace Lucene.Net.Spatial
private double randomGaussianMeanMax(double mean, double max)
{
// DWS: I verified the results empirically
- if (Debugging.AssertsEnabled) Debugging.Assert(() => mean <= max && mean >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(mean <= max && mean >= 0);
double g = randomGaussian();
double mean2 = mean;
double flip = 1;
@@ -180,7 +180,7 @@ namespace Lucene.Net.Spatial
// 1 standard deviation alters the calculation
double pivotMax = max - mean2;
double pivot = Math.Min(mean2, pivotMax / 2);//from 0 to max-mean2
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pivot >= 0 && pivotMax >= pivot && g >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pivot >= 0 && pivotMax >= pivot && g >= 0);
double pivotResult;
if (g <= 1)
pivotResult = pivot * g;
diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/AnalyzingSuggesterTest.cs b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/AnalyzingSuggesterTest.cs
index 4b7301d..bc2ad0f 100644
--- a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/AnalyzingSuggesterTest.cs
+++ b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/AnalyzingSuggesterTest.cs
@@ -651,7 +651,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false);
return 0;
}
}
diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
index 4857d73..d88b6f7 100644
--- a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
+++ b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
@@ -603,7 +603,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false);
return 0;
}
}
@@ -1313,7 +1313,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
else
{
int c = CHARSEQUENCE_COMPARER.Compare(a.Key, b.Key);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => c != 0, () => "term=" + a.Key);
+ if (Debugging.AssertsEnabled) Debugging.Assert(c != 0, () => "term=" + a.Key);
return c;
}
}
diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/TestFreeTextSuggester.cs b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/TestFreeTextSuggester.cs
index 0780c82..e0778ea 100644
--- a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/TestFreeTextSuggester.cs
+++ b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/TestFreeTextSuggester.cs
@@ -680,7 +680,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
return tokens[k];
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false);
return null;
}
diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/LookupBenchmarkTest.cs b/src/Lucene.Net.Tests.Suggest/Suggest/LookupBenchmarkTest.cs
index 14251e7..883a110 100644
--- a/src/Lucene.Net.Tests.Suggest/Suggest/LookupBenchmarkTest.cs
+++ b/src/Lucene.Net.Tests.Suggest/Suggest/LookupBenchmarkTest.cs
@@ -75,7 +75,7 @@ namespace Lucene.Net.Search.Suggest
public override void SetUp()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "disable assertions before running benchmarks!");
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "disable assertions before running benchmarks!");
IList<Input> input = ReadTop50KWiki();
input.Shuffle(Random);
dictionaryInput = input.ToArray();
@@ -93,7 +93,7 @@ namespace Lucene.Net.Search.Suggest
List<Input> input = new List<Input>();
var resource = typeof(LookupBenchmarkTest).FindAndGetManifestResourceStream("Top50KWiki.utf8");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => resource != null, () => "Resource missing: Top50KWiki.utf8");
+ if (Debugging.AssertsEnabled) Debugging.Assert(resource != null, () => "Resource missing: Top50KWiki.utf8");
string line = null;
using (TextReader br = new StreamReader(resource, UTF_8))
diff --git a/src/Lucene.Net.Tests/Analysis/TestGraphTokenizers.cs b/src/Lucene.Net.Tests/Analysis/TestGraphTokenizers.cs
index 1322b74..f351acb 100644
--- a/src/Lucene.Net.Tests/Analysis/TestGraphTokenizers.cs
+++ b/src/Lucene.Net.Tests/Analysis/TestGraphTokenizers.cs
@@ -176,7 +176,7 @@ namespace Lucene.Net.Analysis
pos += minPosLength;
offset = 2 * pos;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => maxPos <= pos, () => "input string mal-formed: posLength>1 tokens hang over the end");
+ if (Debugging.AssertsEnabled) Debugging.Assert(maxPos <= pos, () => "input string mal-formed: posLength>1 tokens hang over the end");
}
}
diff --git a/src/Lucene.Net.Tests/Codecs/Lucene41/TestBlockPostingsFormat3.cs b/src/Lucene.Net.Tests/Codecs/Lucene41/TestBlockPostingsFormat3.cs
index 40b002f..d56e040 100644
--- a/src/Lucene.Net.Tests/Codecs/Lucene41/TestBlockPostingsFormat3.cs
+++ b/src/Lucene.Net.Tests/Codecs/Lucene41/TestBlockPostingsFormat3.cs
@@ -296,7 +296,7 @@ namespace Lucene.Net.Codecs.Lucene41
/// </summary>
public virtual void AssertTermsStatistics(Terms leftTerms, Terms rightTerms)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => leftTerms.Comparer == rightTerms.Comparer);
+ if (Debugging.AssertsEnabled) Debugging.Assert(leftTerms.Comparer == rightTerms.Comparer);
if (leftTerms.DocCount != -1 && rightTerms.DocCount != -1)
{
Assert.AreEqual(leftTerms.DocCount, rightTerms.DocCount);
diff --git a/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldDocValuesFormat.cs b/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldDocValuesFormat.cs
index 0a2e89e..3379c03 100644
--- a/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldDocValuesFormat.cs
+++ b/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldDocValuesFormat.cs
@@ -113,7 +113,7 @@ namespace Lucene.Net.Codecs.PerField
{
Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
Assert.AreEqual(text, hitDoc.Get("fieldname"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ireader.Leaves.Count == 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ireader.Leaves.Count == 1);
NumericDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv1");
Assert.AreEqual(5, dv.Get(hits.ScoreDocs[i].Doc));
BinaryDocValues dv2 = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv2");
diff --git a/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs b/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs
index 2ed15aa..ba498e7 100644
--- a/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs
+++ b/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs
@@ -434,7 +434,7 @@ namespace Lucene.Net.Index
// true if this is a 4.2+ index
bool is42Index = MultiFields.GetMergedFieldInfos(reader).FieldInfo("dvSortedSet") != null;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => is40Index); // NOTE: currently we can only do this on trunk!
+ if (Debugging.AssertsEnabled) Debugging.Assert(is40Index); // NOTE: currently we can only do this on trunk!
IBits liveDocs = MultiFields.GetLiveDocs(reader);
diff --git a/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs b/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs
index 417df93..1a1fea9 100644
--- a/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs
+++ b/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs
@@ -1039,7 +1039,7 @@ namespace Lucene.Net.Index
Assert.AreEqual(1, td.TotalHits);
AtomicReader wrapper = SlowCompositeReaderWrapper.Wrap(ir);
DocsAndPositionsEnum de = wrapper.GetTermPositionsEnum(new Term("field3", "broken"));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => de != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(de != null);
Assert.AreEqual(0, de.NextDoc());
Assert.AreEqual(0, de.NextPosition());
ir.Dispose();
diff --git a/src/Lucene.Net.Tests/Index/TestCodecs.cs b/src/Lucene.Net.Tests/Index/TestCodecs.cs
index 2888663..a9c8d89 100644
--- a/src/Lucene.Net.Tests/Index/TestCodecs.cs
+++ b/src/Lucene.Net.Tests/Index/TestCodecs.cs
@@ -446,7 +446,7 @@ namespace Lucene.Net.Index
for (int i = 0; i < NUM_TEST_THREADS - 1; i++)
{
threads[i].Join();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !threads[i].failed);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!threads[i].failed);
}
}
@@ -759,14 +759,14 @@ namespace Lucene.Net.Index
if (doc == DocIdSetIterator.NO_MORE_DOCS)
{
// skipped past last doc
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto2 == term2.docs.Length - 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto2 == term2.docs.Length - 1);
ended = true;
break;
}
else
{
// skipped to next doc
- if (Debugging.AssertsEnabled) Debugging.Assert(() => upto2 < term2.docs.Length - 1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(upto2 < term2.docs.Length - 1);
if (doc >= term2.docs[1 + upto2])
{
upto2++;
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriter.cs b/src/Lucene.Net.Tests/Index/TestIndexWriter.cs
index a2517f5..2a80fdf 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriter.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriter.cs
@@ -2140,14 +2140,14 @@ namespace Lucene.Net.Index
r = w.GetReader();
long version2 = r.Version;
r.Dispose();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => version2 > version);
+ if (Debugging.AssertsEnabled) Debugging.Assert(version2 > version);
w.DeleteDocuments(new Term("id", "0"));
r = w.GetReader();
w.Dispose();
long version3 = r.Version;
r.Dispose();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => version3 > version2);
+ if (Debugging.AssertsEnabled) Debugging.Assert(version3 > version2);
d.Dispose();
}
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs
index ffdcfdd..eee2d87 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs
@@ -315,7 +315,7 @@ namespace Lucene.Net.Index
}
for (int i = 0; i < merge.Segments.Count; i++)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => merge.Segments[i].Info.DocCount < 20);
+ if (Debugging.AssertsEnabled) Debugging.Assert(merge.Segments[i].Info.DocCount < 20);
}
writer.Merge(merge);
}
diff --git a/src/Lucene.Net.Tests/Index/TestIndexableField.cs b/src/Lucene.Net.Tests/Index/TestIndexableField.cs
index 4308d1a..f171897 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexableField.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexableField.cs
@@ -317,7 +317,7 @@ namespace Lucene.Net.Index
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stringValue != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stringValue != null);
Assert.AreEqual(stringValue, f.GetStringValue());
}
}
@@ -424,7 +424,7 @@ namespace Lucene.Net.Index
return false;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldUpto < outerInstance.fieldCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldUpto < outerInstance.fieldCount);
if (fieldUpto == 0)
{
fieldUpto = 1;
diff --git a/src/Lucene.Net.Tests/Index/TestLongPostings.cs b/src/Lucene.Net.Tests/Index/TestLongPostings.cs
index c9859d7..4ffecfa 100644
--- a/src/Lucene.Net.Tests/Index/TestLongPostings.cs
+++ b/src/Lucene.Net.Tests/Index/TestLongPostings.cs
@@ -462,9 +462,9 @@ namespace Lucene.Net.Index
else
{
docs = postings = TestUtil.Docs(Random, r, "field", new BytesRef(term), null, null, DocsFlags.FREQS);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => postings != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(postings != null);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docs != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docs != null);
int docID = -1;
while (docID < DocIdSetIterator.NO_MORE_DOCS)
diff --git a/src/Lucene.Net.Tests/Index/TestNRTThreads.cs b/src/Lucene.Net.Tests/Index/TestNRTThreads.cs
index 5dfadbf..9a7916d 100644
--- a/src/Lucene.Net.Tests/Index/TestNRTThreads.cs
+++ b/src/Lucene.Net.Tests/Index/TestNRTThreads.cs
@@ -116,7 +116,7 @@ namespace Lucene.Net.Index
protected override Directory GetDirectory(Directory @in)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => @in is MockDirectoryWrapper);
+ if (Debugging.AssertsEnabled) Debugging.Assert(@in is MockDirectoryWrapper);
if (!useNonNrtReaders)
{
((MockDirectoryWrapper)@in).AssertNoDeleteOpenFile = true;
diff --git a/src/Lucene.Net.Tests/Index/TestPayloads.cs b/src/Lucene.Net.Tests/Index/TestPayloads.cs
index 2129822..d536b10 100644
--- a/src/Lucene.Net.Tests/Index/TestPayloads.cs
+++ b/src/Lucene.Net.Tests/Index/TestPayloads.cs
@@ -310,7 +310,7 @@ namespace Lucene.Net.Index
// this test needs the random data to be valid unicode
string s = TestUtil.RandomFixedByteLengthUnicodeString(Random, data.Length);
var b = s.GetBytes(utf8);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => b.Length == data.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(b.Length == data.Length);
System.Buffer.BlockCopy(b, 0, data, 0, b.Length);
}
diff --git a/src/Lucene.Net.Tests/Index/TestPayloadsOnVectors.cs b/src/Lucene.Net.Tests/Index/TestPayloadsOnVectors.cs
index f38c941..d251def 100644
--- a/src/Lucene.Net.Tests/Index/TestPayloadsOnVectors.cs
+++ b/src/Lucene.Net.Tests/Index/TestPayloadsOnVectors.cs
@@ -79,7 +79,7 @@ namespace Lucene.Net.Index
DirectoryReader reader = writer.GetReader();
Terms terms = reader.GetTermVector(1, "field");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => terms != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(terms != null);
TermsEnum termsEnum = terms.GetIterator(null);
Assert.IsTrue(termsEnum.SeekExact(new BytesRef("withPayload")));
DocsAndPositionsEnum de = termsEnum.DocsAndPositions(null, null);
@@ -128,7 +128,7 @@ namespace Lucene.Net.Index
writer.AddDocument(doc);
DirectoryReader reader = writer.GetReader();
Terms terms = reader.GetTermVector(0, "field");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => terms != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(terms != null);
TermsEnum termsEnum = terms.GetIterator(null);
Assert.IsTrue(termsEnum.SeekExact(new BytesRef("withPayload")));
DocsAndPositionsEnum de = termsEnum.DocsAndPositions(null, null);
diff --git a/src/Lucene.Net.Tests/Index/TestPostingsOffsets.cs b/src/Lucene.Net.Tests/Index/TestPostingsOffsets.cs
index 6e96835..0f3ac91 100644
--- a/src/Lucene.Net.Tests/Index/TestPostingsOffsets.cs
+++ b/src/Lucene.Net.Tests/Index/TestPostingsOffsets.cs
@@ -177,9 +177,9 @@ namespace Lucene.Net.Index
{
dp.NextPosition();
int start = dp.StartOffset;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => start >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(start >= 0);
int end = dp.EndOffset;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => end >= 0 && end >= start);
+ if (Debugging.AssertsEnabled) Debugging.Assert(end >= 0 && end >= start);
// check that the offsets correspond to the term in the src text
Assert.IsTrue(storedNumbers.Substring(start, end - start).Equals(term, StringComparison.Ordinal));
if (withPayloads)
@@ -208,9 +208,9 @@ namespace Lucene.Net.Index
string storedNumbers = reader.Document(doc).Get("numbers");
dp.NextPosition();
int start = dp.StartOffset;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => start >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(start >= 0);
int end = dp.EndOffset;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => end >= 0 && end >= start);
+ if (Debugging.AssertsEnabled) Debugging.Assert(end >= 0 && end >= start);
// check that the offsets correspond to the term in the src text
Assert.IsTrue(storedNumbers.Substring(start, end - start).Equals("hundred", StringComparison.Ordinal));
if (withPayloads)
diff --git a/src/Lucene.Net.Tests/Index/TestStressIndexing2.cs b/src/Lucene.Net.Tests/Index/TestStressIndexing2.cs
index b7d7a3c..3209749 100644
--- a/src/Lucene.Net.Tests/Index/TestStressIndexing2.cs
+++ b/src/Lucene.Net.Tests/Index/TestStressIndexing2.cs
@@ -347,7 +347,7 @@ namespace Lucene.Net.Index
}
if (r1.NumDocs != r2.NumDocs)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false, () => "r1.NumDocs=" + r1.NumDocs + " vs r2.NumDocs=" + r2.NumDocs);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false, () => "r1.NumDocs=" + r1.NumDocs + " vs r2.NumDocs=" + r2.NumDocs);
}
bool hasDeletes = !(r1.MaxDoc == r2.MaxDoc && r1.NumDocs == r1.MaxDoc);
@@ -682,7 +682,7 @@ namespace Lucene.Net.Index
IIndexableField f2 = ff2[i];
if (f1.GetBinaryValue() != null)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => f2.GetBinaryValue() != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(f2.GetBinaryValue() != null);
}
else
{
diff --git a/src/Lucene.Net.Tests/Index/TestStressNRT.cs b/src/Lucene.Net.Tests/Index/TestStressNRT.cs
index 3154b56..b552cdb 100644
--- a/src/Lucene.Net.Tests/Index/TestStressNRT.cs
+++ b/src/Lucene.Net.Tests/Index/TestStressNRT.cs
@@ -263,8 +263,8 @@ namespace Lucene.Net.Index
{
// install the new reader if it's newest (and check the current version since another reader may have already been installed)
//System.out.println(Thread.currentThread().getName() + ": newVersion=" + newReader.getVersion());
- if (Debugging.AssertsEnabled) Debugging.Assert(() => newReader.RefCount > 0);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => outerInstance.reader.RefCount > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(newReader.RefCount > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(outerInstance.reader.RefCount > 0);
if (newReader.Version > outerInstance.reader.Version)
{
if (Verbose)
diff --git a/src/Lucene.Net.Tests/Index/TestTermsEnum.cs b/src/Lucene.Net.Tests/Index/TestTermsEnum.cs
index d8dada1..5ac0bf5 100644
--- a/src/Lucene.Net.Tests/Index/TestTermsEnum.cs
+++ b/src/Lucene.Net.Tests/Index/TestTermsEnum.cs
@@ -829,7 +829,7 @@ namespace Lucene.Net.Index
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => loc >= -validTerms.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(loc >= -validTerms.Length);
Assert.AreEqual(TermsEnum.SeekStatus.NOT_FOUND, result);
}
}
diff --git a/src/Lucene.Net.Tests/Search/Spans/MultiSpansWrapper.cs b/src/Lucene.Net.Tests/Search/Spans/MultiSpansWrapper.cs
index bd1216b..d738765 100644
--- a/src/Lucene.Net.Tests/Search/Spans/MultiSpansWrapper.cs
+++ b/src/Lucene.Net.Tests/Search/Spans/MultiSpansWrapper.cs
@@ -110,7 +110,7 @@ namespace Lucene.Net.Search.Spans
}
int subIndex = ReaderUtil.SubIndex(target, leaves);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => subIndex >= leafOrd);
+ if (Debugging.AssertsEnabled) Debugging.Assert(subIndex >= leafOrd);
if (subIndex != leafOrd)
{
AtomicReaderContext ctx = leaves[subIndex];
diff --git a/src/Lucene.Net.Tests/Search/TestBooleanScorer.cs b/src/Lucene.Net.Tests/Search/TestBooleanScorer.cs
index b870992..a257e2b 100644
--- a/src/Lucene.Net.Tests/Search/TestBooleanScorer.cs
+++ b/src/Lucene.Net.Tests/Search/TestBooleanScorer.cs
@@ -119,7 +119,7 @@ namespace Lucene.Net.Search
public override bool Score(ICollector c, int maxDoc)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => doc == -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(doc == -1);
doc = 3000;
FakeScorer fs = new FakeScorer();
fs.doc = doc;
diff --git a/src/Lucene.Net.Tests/Search/TestConstantScoreQuery.cs b/src/Lucene.Net.Tests/Search/TestConstantScoreQuery.cs
index 8a244a0..80747c3 100644
--- a/src/Lucene.Net.Tests/Search/TestConstantScoreQuery.cs
+++ b/src/Lucene.Net.Tests/Search/TestConstantScoreQuery.cs
@@ -234,7 +234,7 @@ namespace Lucene.Net.Search
Filter filter = new QueryWrapperFilter(AssertingQuery.Wrap(Random, new TermQuery(new Term("field", "a"))));
IndexSearcher s = NewSearcher(r);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => s is AssertingIndexSearcher);
+ if (Debugging.AssertsEnabled) Debugging.Assert(s is AssertingIndexSearcher);
// this used to fail
s.Search(new ConstantScoreQuery(filter), new TotalHitCountCollector());
diff --git a/src/Lucene.Net.Tests/Search/TestFieldCache.cs b/src/Lucene.Net.Tests/Search/TestFieldCache.cs
index 7295a56..4c93135 100644
--- a/src/Lucene.Net.Tests/Search/TestFieldCache.cs
+++ b/src/Lucene.Net.Tests/Search/TestFieldCache.cs
@@ -372,7 +372,7 @@ namespace Lucene.Net.Search
break;
}
long ord = termOrds.NextOrd();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ord != SortedSetDocValues.NO_MORE_ORDS);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ord != SortedSetDocValues.NO_MORE_ORDS);
BytesRef scratch = new BytesRef();
termOrds.LookupOrd(ord, scratch);
Assert.AreEqual(v, scratch);
diff --git a/src/Lucene.Net.Tests/Search/TestMinShouldMatch2.cs b/src/Lucene.Net.Tests/Search/TestMinShouldMatch2.cs
index de9b7be..bdecf25 100644
--- a/src/Lucene.Net.Tests/Search/TestMinShouldMatch2.cs
+++ b/src/Lucene.Net.Tests/Search/TestMinShouldMatch2.cs
@@ -365,14 +365,14 @@ namespace Lucene.Net.Search
this.sims = new SimScorer[(int)dv.ValueCount];
foreach (BooleanClause clause in bq.GetClauses())
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !clause.IsProhibited);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !clause.IsRequired);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!clause.IsProhibited);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!clause.IsRequired);
Term term = ((TermQuery)clause.Query).Term;
long ord = dv.LookupTerm(term.Bytes);
if (ord >= 0)
{
bool success = ords.Add(ord);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => success); // no dups
+ if (Debugging.AssertsEnabled) Debugging.Assert(success); // no dups
TermContext context = TermContext.Build(reader.Context, term);
SimWeight w = weight.Similarity.ComputeWeight(1f, searcher.CollectionStatistics("field"), searcher.TermStatistics(term, context));
var dummy = w.GetValueForNormalization(); // ignored
@@ -384,7 +384,7 @@ namespace Lucene.Net.Search
public override float GetScore()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => score != 0, currentMatched.ToString);
+ if (Debugging.AssertsEnabled) Debugging.Assert(score != 0, currentMatched.ToString);
return (float)score * ((BooleanWeight)m_weight).Coord(currentMatched, ((BooleanWeight)m_weight).MaxCoord);
}
@@ -394,7 +394,7 @@ namespace Lucene.Net.Search
public override int NextDoc()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentDoc != NO_MORE_DOCS);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentDoc != NO_MORE_DOCS);
for (currentDoc = currentDoc + 1; currentDoc < maxDoc; currentDoc++)
{
currentMatched = 0;
diff --git a/src/Lucene.Net.Tests/Search/TestMultiThreadTermVectors.cs b/src/Lucene.Net.Tests/Search/TestMultiThreadTermVectors.cs
index d1e61d8..03e4f65 100644
--- a/src/Lucene.Net.Tests/Search/TestMultiThreadTermVectors.cs
+++ b/src/Lucene.Net.Tests/Search/TestMultiThreadTermVectors.cs
@@ -223,7 +223,7 @@ namespace Lucene.Net.Search
foreach (string field in vectors)
{
Terms terms = vectors.GetTerms(field);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => terms != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(terms != null);
VerifyVector(terms.GetIterator(null), num);
}
}
diff --git a/src/Lucene.Net.Tests/Search/TestNumericRangeQuery32.cs b/src/Lucene.Net.Tests/Search/TestNumericRangeQuery32.cs
index 050e28c..82e70ea 100644
--- a/src/Lucene.Net.Tests/Search/TestNumericRangeQuery32.cs
+++ b/src/Lucene.Net.Tests/Search/TestNumericRangeQuery32.cs
@@ -474,13 +474,13 @@ namespace Lucene.Net.Search
int count = 3000;
int lower = (distance * 3 / 2) + startOffset, upper = lower + count * distance + (distance / 3);
// test empty enum
- if (Debugging.AssertsEnabled) Debugging.Assert(() => lower < upper);
+ if (Debugging.AssertsEnabled) Debugging.Assert(lower < upper);
Assert.IsTrue(0 < CountTerms(NumericRangeQuery.NewInt32Range("field4", 4, lower, upper, true, true)));
Assert.AreEqual(0, CountTerms(NumericRangeQuery.NewInt32Range("field4", 4, upper, lower, true, true)));
// test empty enum outside of bounds
lower = distance * noDocs + startOffset;
upper = 2 * lower;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => lower < upper);
+ if (Debugging.AssertsEnabled) Debugging.Assert(lower < upper);
Assert.AreEqual(0, CountTerms(NumericRangeQuery.NewInt32Range("field4", 4, lower, upper, true, true)));
}
diff --git a/src/Lucene.Net.Tests/Search/TestNumericRangeQuery64.cs b/src/Lucene.Net.Tests/Search/TestNumericRangeQuery64.cs
index 4262d3c..db8377f 100644
--- a/src/Lucene.Net.Tests/Search/TestNumericRangeQuery64.cs
+++ b/src/Lucene.Net.Tests/Search/TestNumericRangeQuery64.cs
@@ -501,13 +501,13 @@ namespace Lucene.Net.Search
int count = 3000;
long lower = (distance * 3 / 2) + startOffset, upper = lower + count * distance + (distance / 3);
// test empty enum
- if (Debugging.AssertsEnabled) Debugging.Assert(() => lower < upper);
+ if (Debugging.AssertsEnabled) Debugging.Assert(lower < upper);
Assert.IsTrue(0 < CountTerms(NumericRangeQuery.NewInt64Range("field4", 4, lower, upper, true, true)));
Assert.AreEqual(0, CountTerms(NumericRangeQuery.NewInt64Range("field4", 4, upper, lower, true, true)));
// test empty enum outside of bounds
lower = distance * noDocs + startOffset;
upper = 2L * lower;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => lower < upper);
+ if (Debugging.AssertsEnabled) Debugging.Assert(lower < upper);
Assert.AreEqual(0, CountTerms(NumericRangeQuery.NewInt64Range("field4", 4, lower, upper, true, true)));
}
diff --git a/src/Lucene.Net.Tests/Search/TestTimeLimitingCollector.cs b/src/Lucene.Net.Tests/Search/TestTimeLimitingCollector.cs
index 8118ca6..8162e52 100644
--- a/src/Lucene.Net.Tests/Search/TestTimeLimitingCollector.cs
+++ b/src/Lucene.Net.Tests/Search/TestTimeLimitingCollector.cs
@@ -418,7 +418,7 @@ namespace Lucene.Net.Search
//#endif
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => docId >= 0, () => " base=" + docBase + " doc=" + doc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(docId >= 0, () => " base=" + docBase + " doc=" + doc);
bits.Set(docId);
lastDocCollected = docId;
}
diff --git a/src/Lucene.Net.Tests/Util/Automaton/TestUTF32ToUTF8.cs b/src/Lucene.Net.Tests/Util/Automaton/TestUTF32ToUTF8.cs
index 5addb89..8f72234 100644
--- a/src/Lucene.Net.Tests/Util/Automaton/TestUTF32ToUTF8.cs
+++ b/src/Lucene.Net.Tests/Util/Automaton/TestUTF32ToUTF8.cs
@@ -76,7 +76,7 @@ namespace Lucene.Net.Util.Automaton
nonSurrogateCount = endCode - startCode + 1 - (UnicodeUtil.UNI_SUR_LOW_END - UnicodeUtil.UNI_SUR_HIGH_START + 1);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nonSurrogateCount > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nonSurrogateCount > 0);
for (int iter = 0; iter < iters; iter++)
{
@@ -95,8 +95,8 @@ namespace Lucene.Net.Util.Automaton
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => code >= startCode && code <= endCode, () => "code=" + code + " start=" + startCode + " end=" + endCode);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !IsSurrogate(code));
+ if (Debugging.AssertsEnabled) Debugging.Assert(code >= startCode && code <= endCode, () => "code=" + code + " start=" + startCode + " end=" + endCode);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!IsSurrogate(code));
Assert.IsTrue(Matches(a, code), "DFA for range " + startCode + "-" + endCode + " failed to match code=" + code);
}
diff --git a/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs b/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs
index b262eda..0720328 100644
--- a/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs
+++ b/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs
@@ -571,7 +571,7 @@ namespace Lucene.Net.Util.Fst
long tMid = Environment.TickCount;
Console.WriteLine(((tMid - tStart) / 1000.0) + " sec to add all terms");
- if (Debugging.AssertsEnabled) Debugging.Assert(() => builder.TermCount == ord);
+ if (Debugging.AssertsEnabled) Debugging.Assert(builder.TermCount == ord);
FST<T> fst = builder.Finish();
long tEnd = Environment.TickCount;
Console.WriteLine(((tEnd - tMid) / 1000.0) + " sec to finish/pack");
diff --git a/src/Lucene.Net.Tests/Util/Packed/TestEliasFanoDocIdSet.cs b/src/Lucene.Net.Tests/Util/Packed/TestEliasFanoDocIdSet.cs
index 007eee8..5d3d040 100644
--- a/src/Lucene.Net.Tests/Util/Packed/TestEliasFanoDocIdSet.cs
+++ b/src/Lucene.Net.Tests/Util/Packed/TestEliasFanoDocIdSet.cs
@@ -52,7 +52,7 @@ namespace Lucene.Net.Util.Packed
{
doc = NO_MORE_DOCS;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => doc < numBits);
+ if (Debugging.AssertsEnabled) Debugging.Assert(doc < numBits);
return doc;
}
diff --git a/src/Lucene.Net.Tests/Util/Packed/TestEliasFanoSequence.cs b/src/Lucene.Net.Tests/Util/Packed/TestEliasFanoSequence.cs
index 9111a35..ee29105 100644
--- a/src/Lucene.Net.Tests/Util/Packed/TestEliasFanoSequence.cs
+++ b/src/Lucene.Net.Tests/Util/Packed/TestEliasFanoSequence.cs
@@ -91,7 +91,7 @@ namespace Lucene.Net.Util.Packed
private static void TstDecodeAdvanceToMultiples(long[] values, EliasFanoDecoder efd, long m)
{
// test advancing to multiples of m
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m > 0);
long previousValue = -1L;
long index = 0;
long mm = m;
@@ -120,7 +120,7 @@ namespace Lucene.Net.Util.Packed
private static void TstDecodeBackToMultiples(long[] values, EliasFanoDecoder efd, long m)
{
// test backing to multiples of m
- if (Debugging.AssertsEnabled) Debugging.Assert(() => m > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(m > 0);
efd.ToAfterSequence();
int index = values.Length - 1;
if (index < 0)
@@ -135,7 +135,7 @@ namespace Lucene.Net.Util.Packed
while (index >= 0)
{
expValue = values[index];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => mm < previousValue);
+ if (Debugging.AssertsEnabled) Debugging.Assert(mm < previousValue);
if (expValue <= mm)
{
long backValue_ = efd.BackToValue(mm);
diff --git a/src/Lucene.Net.Tests/Util/Test2BPagedBytes.cs b/src/Lucene.Net.Tests/Util/Test2BPagedBytes.cs
index 8fad1f7..9c044cc 100644
--- a/src/Lucene.Net.Tests/Util/Test2BPagedBytes.cs
+++ b/src/Lucene.Net.Tests/Util/Test2BPagedBytes.cs
@@ -57,7 +57,7 @@ namespace Lucene.Net.Util
r2.NextBytes(bytes);
dataOutput.WriteBytes(bytes, bytes.Length);
long fp = dataOutput.GetFilePointer();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fp == lastFP + numBytes);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fp == lastFP + numBytes);
lastFP = fp;
netBytes += numBytes;
}
diff --git a/src/Lucene.Net.Tests/Util/TestWAH8DocIdSet.cs b/src/Lucene.Net.Tests/Util/TestWAH8DocIdSet.cs
index 3c272c7..a71ef90 100644
--- a/src/Lucene.Net.Tests/Util/TestWAH8DocIdSet.cs
+++ b/src/Lucene.Net.Tests/Util/TestWAH8DocIdSet.cs
@@ -94,7 +94,7 @@ namespace Lucene.Net.Util
/// Create a random set which has <paramref name="numBitsSet"/> of its <paramref name="numBits"/> bits set. </summary>
protected static OpenBitSet RandomOpenSet(int numBits, int numBitsSet)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numBitsSet <= numBits);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numBitsSet <= numBits);
OpenBitSet set = new OpenBitSet(numBits);
Random random = Random;
if (numBitsSet == numBits)
diff --git a/src/Lucene.Net/Analysis/NumericTokenStream.cs b/src/Lucene.Net/Analysis/NumericTokenStream.cs
index ace2805..67a3671 100644
--- a/src/Lucene.Net/Analysis/NumericTokenStream.cs
+++ b/src/Lucene.Net/Analysis/NumericTokenStream.cs
@@ -178,7 +178,7 @@ namespace Lucene.Net.Analysis
public void FillBytesRef()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ValueSize == 64 || ValueSize == 32);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ValueSize == 64 || ValueSize == 32);
if (ValueSize == 64)
{
NumericUtils.Int64ToPrefixCoded(_value, Shift, _bytes);
diff --git a/src/Lucene.Net/Analysis/TokenStreamToAutomaton.cs b/src/Lucene.Net/Analysis/TokenStreamToAutomaton.cs
index c70f8fe..c015135 100644
--- a/src/Lucene.Net/Analysis/TokenStreamToAutomaton.cs
+++ b/src/Lucene.Net/Analysis/TokenStreamToAutomaton.cs
@@ -155,7 +155,7 @@ namespace Lucene.Net.Analysis
{
posInc = 1;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pos > -1 || posInc > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pos > -1 || posInc > 0);
if (posInc > 0)
{
@@ -163,7 +163,7 @@ namespace Lucene.Net.Analysis
pos += posInc;
posData = positions.Get(pos);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => posData.leaving == null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(posData.leaving == null);
if (posData.arriving == null)
{
diff --git a/src/Lucene.Net/Analysis/Tokenizer.cs b/src/Lucene.Net/Analysis/Tokenizer.cs
index 36acdea..249b60f 100644
--- a/src/Lucene.Net/Analysis/Tokenizer.cs
+++ b/src/Lucene.Net/Analysis/Tokenizer.cs
@@ -115,7 +115,7 @@ namespace Lucene.Net.Analysis
throw new InvalidOperationException("TokenStream contract violation: Close() call missing");
}
this.inputPending = input;
- if (Debugging.AssertsEnabled) Debugging.Assert(SetReaderTestPoint);
+ if (Debugging.AssertsEnabled) Debugging.Assert(SetReaderTestPoint());
}
public override void Reset()
diff --git a/src/Lucene.Net/Codecs/BlockTermState.cs b/src/Lucene.Net/Codecs/BlockTermState.cs
index 13a8bd7..3768b6b 100644
--- a/src/Lucene.Net/Codecs/BlockTermState.cs
+++ b/src/Lucene.Net/Codecs/BlockTermState.cs
@@ -57,7 +57,7 @@ namespace Lucene.Net.Codecs
public override void CopyFrom(TermState other)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => other is BlockTermState, () => "can not copy from " + other.GetType().Name);
+ if (Debugging.AssertsEnabled) Debugging.Assert(other is BlockTermState, () => "can not copy from " + other.GetType().Name);
BlockTermState other2 = (BlockTermState)other;
base.CopyFrom(other);
DocFreq = other2.DocFreq;
diff --git a/src/Lucene.Net/Codecs/BlockTreeTermsReader.cs b/src/Lucene.Net/Codecs/BlockTreeTermsReader.cs
index a3f1591..5d1b55b 100644
--- a/src/Lucene.Net/Codecs/BlockTreeTermsReader.cs
+++ b/src/Lucene.Net/Codecs/BlockTreeTermsReader.cs
@@ -167,13 +167,13 @@ namespace Lucene.Net.Codecs
{
int field = @in.ReadVInt32();
long numTerms = @in.ReadVInt64();
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numTerms >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numTerms >= 0);
int numBytes = @in.ReadVInt32();
BytesRef rootCode = new BytesRef(new byte[numBytes]);
@in.ReadBytes(rootCode.Bytes, 0, numBytes);
rootCode.Length = numBytes;
FieldInfo fieldInfo = fieldInfos.FieldInfo(field);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fieldInfo != null, () => "field=" + field);
+ if (Debugging.AssertsEnabled) Debugging.Assert(fieldInfo != null, () => "field=" + field);
long sumTotalTermFreq = fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY ? -1 : @in.ReadVInt64();
long sumDocFreq = @in.ReadVInt64();
int docCount = @in.ReadVInt32();
@@ -291,7 +291,7 @@ namespace Lucene.Net.Codecs
public override Terms GetTerms(string field)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => field != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(field != null);
FieldReader ret;
fields.TryGetValue(field, out ret);
return ret;
@@ -478,7 +478,7 @@ namespace Lucene.Net.Codecs
}
endBlockCount++;
long otherBytes = frame.fpEnd - frame.fp - frame.suffixesReader.Length - frame.statsReader.Length;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => otherBytes > 0, () => "otherBytes=" + otherBytes + " frame.fp=" + frame.fp + " frame.fpEnd=" + frame.fpEnd);
+ if (Debugging.AssertsEnabled) Debugging.Assert(otherBytes > 0, () => "otherBytes=" + otherBytes + " frame.fp=" + frame.fp + " frame.fpEnd=" + frame.fpEnd);
TotalBlockOtherBytes += otherBytes;
}
@@ -491,9 +491,9 @@ namespace Lucene.Net.Codecs
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => startBlockCount == endBlockCount, () => "startBlockCount=" + startBlockCount + " endBlockCount=" + endBlockCount);
- Debugging.Assert(() => TotalBlockCount == FloorSubBlockCount + NonFloorBlockCount, () => "floorSubBlockCount=" + FloorSubBlockCount + " nonFloorBlockCount=" + NonFloorBlockCount + " totalBlockCount=" + TotalBlockCount);
- Debugging.Assert(() => TotalBlockCount == MixedBlockCount + TermsOnlyBlockCount + SubBlocksOnlyBlockCount, () => "totalBlockCount=" + TotalBlockCount + " mixedBlockCount=" + MixedBlockCount + " subBlocksOnlyBlockCount=" + SubBlocksOnlyBlockCount + " termsOnlyBlockCount=" + TermsOnlyBlockCount);
+ Debugging.Assert(startBlockCount == endBlockCount, () => "startBlockCount=" + startBlockCount + " endBlockCount=" + endBlockCount);
+ Debugging.Assert(TotalBlockCount == FloorSubBlockCount + NonFloorBlockCount, () => "floorSubBlockCount=" + FloorSubBlockCount + " nonFloorBlockCount=" + NonFloorBlockCount + " totalBlockCount=" + TotalBlockCount);
+ Debugging.Assert(TotalBlockCount == MixedBlockCount + TermsOnlyBlockCount + SubBlocksOnlyBlockCount, () => "totalBlockCount=" + TotalBlockCount + " mixedBlockCount=" + MixedBlockCount + " subBlocksOnlyBlockCount=" + SubBlocksOnlyBlockCount + " termsOnlyBlockCount=" + TermsOnlyBlockCount);
}
}
@@ -532,7 +532,7 @@ namespace Lucene.Net.Codecs
@out.AppendLine(" " + prefix.ToString().PadLeft(2, ' ') + ": " + blockCount);
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => TotalBlockCount == total);
+ if (Debugging.AssertsEnabled) Debugging.Assert(TotalBlockCount == total);
}
return @out.ToString();
}
@@ -563,7 +563,7 @@ namespace Lucene.Net.Codecs
internal FieldReader(BlockTreeTermsReader outerInstance, FieldInfo fieldInfo, long numTerms, BytesRef rootCode, long sumTotalTermFreq, long sumDocFreq, int docCount, long indexStartFP, int longsSize, IndexInput indexIn)
{
this.outerInstance = outerInstance;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numTerms > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numTerms > 0);
this.fieldInfo = fieldInfo;
//DEBUG = BlockTreeTermsReader.DEBUG && fieldInfo.name.Equals("id", StringComparison.Ordinal);
this.numTerms = numTerms;
@@ -763,7 +763,7 @@ namespace Lucene.Net.Codecs
internal void LoadNextFloorBlock()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numFollowFloorBlocks > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numFollowFloorBlocks > 0);
//if (DEBUG) System.out.println(" loadNextFoorBlock trans=" + transitions[transitionIndex]);
do
@@ -848,7 +848,7 @@ namespace Lucene.Net.Codecs
outerInstance.@in.Seek(fp);
int code_ = outerInstance.@in.ReadVInt32();
entCount = (int)((uint)code_ >> 1);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => entCount > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(entCount > 0);
isLastInFloor = (code_ & 1) != 0;
// term suffixes:
@@ -909,7 +909,7 @@ namespace Lucene.Net.Codecs
public bool NextLeaf()
{
//if (DEBUG) System.out.println(" frame.next ord=" + ord + " nextEnt=" + nextEnt + " entCount=" + entCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextEnt != -1 && nextEnt < entCount, () => "nextEnt=" + nextEnt + " entCount=" + entCount + " fp=" + fp);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextEnt != -1 && nextEnt < entCount, () => "nextEnt=" + nextEnt + " entCount=" + entCount + " fp=" + fp);
nextEnt++;
suffix = suffixesReader.ReadVInt32();
startBytePos = suffixesReader.Position;
@@ -920,7 +920,7 @@ namespace Lucene.Net.Codecs
public bool NextNonLeaf()
{
//if (DEBUG) System.out.println(" frame.next ord=" + ord + " nextEnt=" + nextEnt + " entCount=" + entCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextEnt != -1 && nextEnt < entCount, () => "nextEnt=" + nextEnt + " entCount=" + entCount + " fp=" + fp);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextEnt != -1 && nextEnt < entCount, () => "nextEnt=" + nextEnt + " entCount=" + entCount + " fp=" + fp);
nextEnt++;
int code = suffixesReader.ReadVInt32();
suffix = (int)((uint)code >> 1);
@@ -947,7 +947,7 @@ namespace Lucene.Net.Codecs
// lazily catch up on metadata decode:
int limit = TermBlockOrd;
bool absolute = metaDataUpto == 0;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => limit > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(limit > 0);
// TODO: better API would be "jump straight to term=N"???
while (metaDataUpto < limit)
@@ -1024,7 +1024,7 @@ namespace Lucene.Net.Codecs
FST.Arc<BytesRef> arc = outerInstance.index.GetFirstArc(arcs[0]);
// Empty string prefix must have an output in the index!
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.IsFinal);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.IsFinal);
// Special pushFrame since it's the first one:
Frame f = stack[0];
@@ -1036,7 +1036,7 @@ namespace Lucene.Net.Codecs
f.Load(outerInstance.rootCode);
// for assert:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => SetSavedStartTerm(startTerm));
+ if (Debugging.AssertsEnabled) Debugging.Assert(SetSavedStartTerm(startTerm));
currentFrame = f;
if (startTerm != null)
@@ -1070,7 +1070,7 @@ namespace Lucene.Net.Codecs
}
stack = next;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stack[ord].ord == ord);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stack[ord].ord == ord);
return stack[ord];
}
@@ -1104,7 +1104,7 @@ namespace Lucene.Net.Codecs
// possible:
FST.Arc<BytesRef> arc = currentFrame.arc;
int idx = currentFrame.prefix;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentFrame.suffix > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentFrame.suffix > 0);
BytesRef output = currentFrame.outputPrefix;
while (idx < f.prefix)
{
@@ -1113,14 +1113,14 @@ namespace Lucene.Net.Codecs
// case by using current arc as starting point,
// passed to findTargetArc
arc = outerInstance.index.FindTargetArc(target, arc, GetArc(1 + idx), fstReader);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc != null);
output = outerInstance.outerInstance.fstOutputs.Add(output, arc.Output);
idx++;
}
f.arc = arc;
f.outputPrefix = output;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.IsFinal);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.IsFinal);
f.Load(outerInstance.outerInstance.fstOutputs.Add(output, arc.NextFinalOutput));
return f;
}
@@ -1171,7 +1171,7 @@ namespace Lucene.Net.Codecs
for (int idx = 0; idx < currentFrame.suffix; idx++)
{
state = runAutomaton.Step(state, currentFrame.suffixBytes[currentFrame.startBytePos + idx] & 0xff);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state != -1);
}
return state;
}
@@ -1183,13 +1183,13 @@ namespace Lucene.Net.Codecs
private void SeekToStartTerm(BytesRef target)
{
//if (DEBUG) System.out.println("seek to startTerm=" + target.utf8ToString());
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentFrame.ord == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentFrame.ord == 0);
if (term.Length < target.Length)
{
term.Bytes = ArrayUtil.Grow(term.Bytes, target.Length);
}
FST.Arc<BytesRef> arc = arcs[0];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc == currentFrame.arc);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc == currentFrame.arc);
for (int idx = 0; idx <= target.Length; idx++)
{
@@ -1267,7 +1267,7 @@ namespace Lucene.Net.Codecs
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => false);
+ if (Debugging.AssertsEnabled) Debugging.Assert(false);
}
public override BytesRef Next()
@@ -1297,7 +1297,7 @@ namespace Lucene.Net.Codecs
}
long lastFP = currentFrame.fpOrig;
currentFrame = stack[currentFrame.ord - 1];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentFrame.lastSubFP == lastFP);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentFrame.lastSubFP == lastFP);
//if (DEBUG) System.out.println("\n frame ord=" + currentFrame.ord + " prefix=" + brToString(new BytesRef(term.bytes, term.offset, currentFrame.prefix)) + " state=" + currentFrame.state + " lastInFloor?=" + currentFrame.isLastInFloor + " fp=" + currentFrame.fp + " trans=" + (currentFrame.transitions.length == 0 ? "n/a" : currentFrame.transitions[currentFrame.transitionIndex]) + " outputPrefix=" + currentFrame.outputPrefix);
}
}
@@ -1351,7 +1351,7 @@ namespace Lucene.Net.Codecs
byte[] commonSuffixBytes = compiledAutomaton.CommonSuffixRef.Bytes;
int lenInPrefix = compiledAutomaton.CommonSuffixRef.Length - currentFrame.suffix;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => compiledAutomaton.CommonSuffixRef.Offset == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(compiledAutomaton.CommonSuffixRef.Offset == 0);
int suffixBytesPos;
int commonSuffixBytesPos = 0;
@@ -1362,7 +1362,7 @@ namespace Lucene.Net.Codecs
// test whether the prefix part matches:
byte[] termBytes = term.Bytes;
int termBytesPos = currentFrame.prefix - lenInPrefix;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => termBytesPos >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(termBytesPos >= 0);
int termBytesPosEnd = currentFrame.prefix;
while (termBytesPos < termBytesPosEnd)
{
@@ -1430,7 +1430,7 @@ namespace Lucene.Net.Codecs
{
CopyTerm();
//if (DEBUG) System.out.println(" term match to state=" + state + "; return term=" + brToString(term));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => savedStartTerm == null || term.CompareTo(savedStartTerm) > 0, () => "saveStartTerm=" + savedStartTerm.Utf8ToString() + " term=" + term.Utf8ToString());
+ if (Debugging.AssertsEnabled) Debugging.Assert(savedStartTerm == null || term.CompareTo(savedStartTerm) > 0, () => "saveStartTerm=" + savedStartTerm.Utf8ToString() + " term=" + term.Utf8ToString());
return term;
}
else
@@ -1534,7 +1534,7 @@ namespace Lucene.Net.Codecs
{
arc = outerInstance.index.GetFirstArc(arcs[0]);
// Empty string prefix must have an output in the index!
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.IsFinal);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.IsFinal);
}
else
{
@@ -1582,7 +1582,7 @@ namespace Lucene.Net.Codecs
{
arc = outerInstance.index.GetFirstArc(arcs[0]);
// Empty string prefix must have an output in the index!
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.IsFinal);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.IsFinal);
}
else
{
@@ -1617,7 +1617,7 @@ namespace Lucene.Net.Codecs
}
long lastFP = currentFrame.fpOrig;
currentFrame = stack[currentFrame.ord - 1];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => lastFP == currentFrame.lastSubFP);
+ if (Debugging.AssertsEnabled) Debugging.Assert(lastFP == currentFrame.lastSubFP);
// if (DEBUG) {
// System.out.println(" reset validIndexPrefix=" + validIndexPrefix);
// }
@@ -1657,7 +1657,7 @@ namespace Lucene.Net.Codecs
{
arc = outerInstance.index.GetFirstArc(arcs[0]);
// Empty string prefix must have an output in the index!
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.IsFinal);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.IsFinal);
}
else
{
@@ -1684,7 +1684,7 @@ namespace Lucene.Net.Codecs
}
stack = next;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stack[ord].ord == ord);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stack[ord].ord == ord);
return stack[ord];
}
@@ -1743,7 +1743,7 @@ namespace Lucene.Net.Codecs
// System.out.println(" skip rewind!");
// }
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => length == f.prefix);
+ if (Debugging.AssertsEnabled) Debugging.Assert(length == f.prefix);
}
else
{
@@ -1789,7 +1789,7 @@ namespace Lucene.Net.Codecs
term.Bytes = ArrayUtil.Grow(term.Bytes, 1 + target.Length);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ClearEOF());
+ if (Debugging.AssertsEnabled) Debugging.Assert(ClearEOF());
FST.Arc<BytesRef> arc;
int targetUpto;
@@ -1811,12 +1811,12 @@ namespace Lucene.Net.Codecs
// }
arc = arcs[0];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.IsFinal);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.IsFinal);
output = arc.Output;
targetUpto = 0;
Frame lastFrame = stack[0];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => validIndexPrefix <= term.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(validIndexPrefix <= term.Length);
int targetLimit = Math.Min(target.Length, validIndexPrefix);
@@ -1840,7 +1840,7 @@ namespace Lucene.Net.Codecs
//if (arc.label != (target.bytes[target.offset + targetUpto] & 0xFF)) {
//System.out.println("FAIL: arc.label=" + (char) arc.label + " targetLabel=" + (char) (target.bytes[target.offset + targetUpto] & 0xFF));
//}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.Label == (target.Bytes[target.Offset + targetUpto] & 0xFF), () => "arc.label=" + (char)arc.Label + " targetLabel=" + (char)(target.Bytes[target.Offset + targetUpto] & 0xFF));
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.Label == (target.Bytes[target.Offset + targetUpto] & 0xFF), () => "arc.label=" + (char)arc.Label + " targetLabel=" + (char)(target.Bytes[target.Offset + targetUpto] & 0xFF));
if (arc.Output != outerInstance.outerInstance.NO_OUTPUT)
{
output = outerInstance.outerInstance.fstOutputs.Add(output, arc.Output);
@@ -1907,7 +1907,7 @@ namespace Lucene.Net.Codecs
else
{
// Target is exactly the same as current term
- if (Debugging.AssertsEnabled) Debugging.Assert(() => term.Length == target.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(term.Length == target.Length);
if (termExists)
{
// if (DEBUG) {
@@ -1934,8 +1934,8 @@ namespace Lucene.Net.Codecs
// Empty string prefix must have an output (block) in the index!
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => arc.IsFinal);
- Debugging.Assert(() => arc.Output != null);
+ Debugging.Assert(arc.IsFinal);
+ Debugging.Assert(arc.Output != null);
}
// if (DEBUG) {
@@ -2008,7 +2008,7 @@ namespace Lucene.Net.Codecs
arc = nextArc;
term.Bytes[targetUpto] = (byte)targetLabel;
// Aggregate output as we go:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.Output != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.Output != null);
if (arc.Output != outerInstance.outerInstance.NO_OUTPUT)
{
output = outerInstance.outerInstance.fstOutputs.Add(output, arc.Output);
@@ -2076,7 +2076,7 @@ namespace Lucene.Net.Codecs
term.Bytes = ArrayUtil.Grow(term.Bytes, 1 + target.Length);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(ClearEOF);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ClearEOF());
//if (DEBUG) {
//System.out.println("\nBTTR.seekCeil seg=" + segment + " target=" + fieldInfo.name + ":" + target.utf8ToString() + " " + target + " current=" + brToString(term) + " (exists?=" + termExists + ") validIndexPrefix= " + validIndexPrefix);
@@ -2103,12 +2103,12 @@ namespace Lucene.Net.Codecs
//}
arc = arcs[0];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.IsFinal);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.IsFinal);
output = arc.Output;
targetUpto = 0;
Frame lastFrame = stack[0];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => validIndexPrefix <= term.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(validIndexPrefix <= term.Length);
int targetLimit = Math.Min(target.Length, validIndexPrefix);
@@ -2129,7 +2129,7 @@ namespace Lucene.Net.Codecs
break;
}
arc = arcs[1 + targetUpto];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.Label == (target.Bytes[target.Offset + targetUpto] & 0xFF), () => "arc.label=" + (char)arc.Label + " targetLabel=" + (char)(target.Bytes[target.Offset + targetUpto] & 0xFF));
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.Label == (target.Bytes[target.Offset + targetUpto] & 0xFF), () => "arc.label=" + (char)arc.Label + " targetLabel=" + (char)(target.Bytes[target.Offset + targetUpto] & 0xFF));
// TOOD: we could save the outputs in local
// byte[][] instead of making new objs ever
// seek; but, often the FST doesn't have any
@@ -2198,7 +2198,7 @@ namespace Lucene.Net.Codecs
else
{
// Target is exactly the same as current term
- if (Debugging.AssertsEnabled) Debugging.Assert(() => term.Length == target.Length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(term.Length == target.Length);
if (termExists)
{
//if (DEBUG) {
@@ -2222,8 +2222,8 @@ namespace Lucene.Net.Codecs
// Empty string prefix must have an output (block) in the index!
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => arc.IsFinal);
- Debugging.Assert(() => arc.Output != null);
+ Debugging.Assert(arc.IsFinal);
+ Debugging.Assert(arc.Output != null);
}
//if (DEBUG) {
@@ -2298,7 +2298,7 @@ namespace Lucene.Net.Codecs
term.Bytes[targetUpto] = (byte)targetLabel;
arc = nextArc;
// Aggregate output as we go:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.Output != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.Output != null);
if (arc.Output != outerInstance.outerInstance.NO_OUTPUT)
{
output = outerInstance.outerInstance.fstOutputs.Add(output, arc.Output);
@@ -2431,7 +2431,7 @@ namespace Lucene.Net.Codecs
{
arc = outerInstance.index.GetFirstArc(arcs[0]);
// Empty string prefix must have an output in the index!
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc.IsFinal);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc.IsFinal);
}
else
{
@@ -2443,7 +2443,7 @@ namespace Lucene.Net.Codecs
targetBeforeCurrentLength = currentFrame.ord;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !eof);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!eof);
//if (DEBUG) {
//System.out.println("\nBTTR.next seg=" + segment + " term=" + brToString(term) + " termExists?=" + termExists + " field=" + fieldInfo.name + " termBlockOrd=" + currentFrame.state.termBlockOrd + " validIndexPrefix=" + validIndexPrefix);
//printSeekState();
@@ -2459,7 +2459,7 @@ namespace Lucene.Net.Codecs
// works properly:
//if (DEBUG) System.out.println(" re-seek to pending term=" + term.utf8ToString() + " " + term);
bool result = SeekExact(term);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => result);
+ if (Debugging.AssertsEnabled) Debugging.Assert(result);
}
// Pop finished blocks
@@ -2475,7 +2475,7 @@ namespace Lucene.Net.Codecs
if (currentFrame.ord == 0)
{
//if (DEBUG) System.out.println(" return null");
- if (Debugging.AssertsEnabled) Debugging.Assert(SetEOF);
+ if (Debugging.AssertsEnabled) Debugging.Assert(SetEOF());
term.Length = 0;
validIndexPrefix = 0;
currentFrame.Rewind();
@@ -2529,7 +2529,7 @@ namespace Lucene.Net.Codecs
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !eof);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!eof);
return term;
}
}
@@ -2538,7 +2538,7 @@ namespace Lucene.Net.Codecs
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !eof);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!eof);
//if (DEBUG) System.out.println("BTR.docFreq");
currentFrame.DecodeMetaData();
//if (DEBUG) System.out.println(" return " + currentFrame.state.docFreq);
@@ -2550,7 +2550,7 @@ namespace Lucene.Net.Codecs
{
get
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !eof);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!eof);
currentFrame.DecodeMetaData();
return currentFrame.state.TotalTermFreq;
}
@@ -2558,7 +2558,7 @@ namespace Lucene.Net.Codecs
public override DocsEnum Docs(IBits skipDocs, DocsEnum reuse, DocsFlags flags)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !eof);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!eof);
//if (DEBUG) {
//System.out.println("BTTR.docs seg=" + segment);
//}
@@ -2577,7 +2577,7 @@ namespace Lucene.Net.Codecs
return null;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !eof);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!eof);
currentFrame.DecodeMetaData();
return outerInstance.outerInstance.postingsReader.DocsAndPositions(outerInstance.fieldInfo, currentFrame.state, skipDocs, reuse, flags);
}
@@ -2587,15 +2587,15 @@ namespace Lucene.Net.Codecs
// if (DEBUG) {
// System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
// }
- if (Debugging.AssertsEnabled) Debugging.Assert(ClearEOF);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ClearEOF());
if (target.CompareTo(term) != 0 || !termExists)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => otherState != null && otherState is BlockTermState);
+ if (Debugging.AssertsEnabled) Debugging.Assert(otherState != null && otherState is BlockTermState);
currentFrame = staticFrame;
currentFrame.state.CopyFrom(otherState);
term.CopyBytes(target);
currentFrame.metaDataUpto = currentFrame.TermBlockOrd;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentFrame.metaDataUpto > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentFrame.metaDataUpto > 0);
validIndexPrefix = 0;
}
else
@@ -2608,7 +2608,7 @@ namespace Lucene.Net.Codecs
public override TermState GetTermState()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !eof);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!eof);
currentFrame.DecodeMetaData();
TermState ts = (TermState)currentFrame.state.Clone();
//if (DEBUG) System.out.println("BTTR.termState seg=" + segment + " state=" + ts);
@@ -2740,7 +2740,7 @@ namespace Lucene.Net.Codecs
//if (DEBUG) {
//System.out.println(" loadNextFloorBlock fp=" + fp + " fpEnd=" + fpEnd);
//}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc == null || isFloor, () => "arc=" + arc + " isFloor=" + isFloor);
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc == null || isFloor, () => "arc=" + arc + " isFloor=" + isFloor);
fp = fpEnd;
nextEnt = -1;
LoadBlock();
@@ -2774,9 +2774,9 @@ namespace Lucene.Net.Codecs
outerInstance.@in.Seek(fp);
int code = outerInstance.@in.ReadVInt32();
entCount = (int)((uint)code >> 1);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => entCount > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(entCount > 0);
isLastInFloor = (code & 1) != 0;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => arc == null || (isLastInFloor || isFloor));
+ if (Debugging.AssertsEnabled) Debugging.Assert(arc == null || (isLastInFloor || isFloor));
// TODO: if suffixes were stored in random-access
// array structure, then we could do binary search
@@ -2897,7 +2897,7 @@ namespace Lucene.Net.Codecs
public bool NextLeaf()
{
//if (DEBUG) System.out.println(" frame.next ord=" + ord + " nextEnt=" + nextEnt + " entCount=" + entCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextEnt != -1 && nextEnt < entCount, () => "nextEnt=" + nextEnt + " entCount=" + entCount + " fp=" + fp);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextEnt != -1 && nextEnt < entCount, () => "nextEnt=" + nextEnt + " entCount=" + entCount + " fp=" + fp);
nextEnt++;
suffix = suffixesReader.ReadVInt32();
startBytePos = suffixesReader.Position;
@@ -2915,7 +2915,7 @@ namespace Lucene.Net.Codecs
public bool NextNonLeaf()
{
//if (DEBUG) System.out.println(" frame.next ord=" + ord + " nextEnt=" + nextEnt + " entCount=" + entCount);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextEnt != -1 && nextEnt < entCount, () => "nextEnt=" + nextEnt + " entCount=" + entCount + " fp=" + fp);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextEnt != -1 && nextEnt < entCount, () => "nextEnt=" + nextEnt + " entCount=" + entCount + " fp=" + fp);
nextEnt++;
int code = suffixesReader.ReadVInt32();
suffix = (int)((uint)code >> 1);
@@ -2974,7 +2974,7 @@ namespace Lucene.Net.Codecs
return;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numFollowFloorBlocks != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numFollowFloorBlocks != 0);
long newFP = fpOrig;
while (true)
@@ -3034,7 +3034,7 @@ namespace Lucene.Net.Codecs
// lazily catch up on metadata decode:
int limit = TermBlockOrd;
bool absolute = metaDataUpto == 0;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => limit > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(limit > 0);
// TODO: better API would be "jump straight to term=N"???
while (metaDataUpto < limit)
@@ -3090,7 +3090,7 @@ namespace Lucene.Net.Codecs
/// </summary>
public void ScanToSubBlock(long subFP)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => !isLeafBlock);
+ if (Debugging.AssertsEnabled) Debugging.Assert(!isLeafBlock);
//if (DEBUG) System.out.println(" scanToSubBlock fp=" + fp + " subFP=" + subFP + " entCount=" + entCount + " lastSubFP=" + lastSubFP);
//assert nextEnt == 0;
if (lastSubFP == subFP)
@@ -3098,12 +3098,12 @@ namespace Lucene.Net.Codecs
//if (DEBUG) System.out.println(" already positioned");
return;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => subFP < fp, () => "fp=" + fp + " subFP=" + subFP);
+ if (Debugging.AssertsEnabled) Debugging.Assert(subFP < fp, () => "fp=" + fp + " subFP=" + subFP);
long targetSubCode = fp - subFP;
//if (DEBUG) System.out.println(" targetSubCode=" + targetSubCode);
while (true)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextEnt < entCount);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextEnt < entCount);
nextEnt++;
int code = suffixesReader.ReadVInt32();
suffixesReader.SkipBytes(isLeafBlock ? code : (int)((uint)code >> 1));
@@ -3142,7 +3142,7 @@ namespace Lucene.Net.Codecs
{
// if (DEBUG) System.out.println(" scanToTermLeaf: block fp=" + fp + " prefix=" + prefix + " nextEnt=" + nextEnt + " (of " + entCount + ") target=" + brToString(target) + " term=" + brToString(term));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextEnt != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextEnt != -1);
outerInstance.termExists = true;
subCode = 0;
@@ -3156,7 +3156,7 @@ namespace Lucene.Net.Codecs
return SeekStatus.END;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => PrefixMatches(target));
+ if (Debugging.AssertsEnabled) Debugging.Assert(PrefixMatches(target));
// Loop over each entry (term or sub-block) in this block:
//nextTerm: while(nextEnt < entCount) {
@@ -3195,7 +3195,7 @@ namespace Lucene.Net.Codecs
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => targetPos == targetLimit);
+ if (Debugging.AssertsEnabled) Debugging.Assert(targetPos == targetLimit);
cmp = termLen - target.Length;
stop = true;
}
@@ -3251,7 +3251,7 @@ namespace Lucene.Net.Codecs
// would have followed the index to this
// sub-block from the start:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => outerInstance.termExists);
+ if (Debugging.AssertsEnabled) Debugging.Assert(outerInstance.termExists);
FillTerm();
//if (DEBUG) System.out.println(" found!");
return SeekStatus.FOUND;
@@ -3288,7 +3288,7 @@ namespace Lucene.Net.Codecs
{
//if (DEBUG) System.out.println(" scanToTermNonLeaf: block fp=" + fp + " prefix=" + prefix + " nextEnt=" + nextEnt + " (of " + entCount + ") target=" + brToString(target) + " term=" + brToString(term));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => nextEnt != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(nextEnt != -1);
if (nextEnt == entCount)
{
@@ -3300,7 +3300,7 @@ namespace Lucene.Net.Codecs
return SeekStatus.END;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => PrefixMatches(target));
+ if (Debugging.AssertsEnabled) Debugging.Assert(PrefixMatches(target));
// Loop over each entry (term or sub-block) in this block:
//nextTerm: while(nextEnt < entCount) {
@@ -3350,7 +3350,7 @@ namespace Lucene.Net.Codecs
}
else
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => targetPos == targetLimit);
+ if (Debugging.AssertsEnabled) Debugging.Assert(targetPos == targetLimit);
cmp = termLen - target.Length;
stop = true;
}
@@ -3407,7 +3407,7 @@ namespace Lucene.Net.Codecs
// would have followed the index to this
// sub-block from the start:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => outerInstance.termExists);
+ if (Debugging.AssertsEnabled) Debugging.Assert(outerInstance.termExists);
FillTerm();
//if (DEBUG) System.out.println(" found!");
return SeekStatus.FOUND;
diff --git a/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs b/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs
index 7f5065a..43b9a9f 100644
--- a/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs
+++ b/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs
@@ -259,9 +259,9 @@ namespace Lucene.Net.Codecs
public FieldMetaData(FieldInfo fieldInfo, BytesRef rootCode, long numTerms, long indexStartFP, long sumTotalTermFreq, long sumDocFreq, int docCount, int longsSize)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => numTerms > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(numTerms > 0);
this.FieldInfo = fieldInfo;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => rootCode != null, () => "field=" + fieldInfo.Name + " numTerms=" + numTerms);
+ if (Debugging.AssertsEnabled) Debugging.Assert(rootCode != null, () => "field=" + fieldInfo.Name + " numTerms=" + numTerms);
this.RootCode = rootCode;
this.IndexStartFP = indexStartFP;
this.NumTerms = numTerms;
@@ -368,14 +368,14 @@ namespace Lucene.Net.Codecs
{
//DEBUG = field.name.Equals("id", StringComparison.Ordinal);
//if (DEBUG) System.out.println("\nBTTW.addField seg=" + segment + " field=" + field.name);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => currentField == null || currentField.Name.CompareToOrdinal(field.Name) < 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(currentField == null || currentField.Name.CompareToOrdinal(field.Name) < 0);
currentField = field;
return new TermsWriter(this, field);
}
internal static long EncodeOutput(long fp, bool hasTerms, bool isFloor)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => fp < (1L << 62));
+ if (Debugging.AssertsEnabled) Debugging.Assert(fp < (1L << 62));
return (fp << 2) | (uint)(hasTerms ? OUTPUT_FLAG_HAS_TERMS : 0) | (uint)(isFloor ? OUTPUT_FLAG_IS_FLOOR : 0);
}
@@ -481,10 +481,10 @@ namespace Lucene.Net.Codecs
// LUCENENET specific - we use a custom wrapper function to display floorBlocks, since
// it might contain garbage that cannot be converted into text.
if (Debugging.AssertsEnabled) Debugging.Assert(
- () => (IsFloor && floorBlocks != null && floorBlocks.Count != 0) || (!IsFloor && floorBlocks == null),
+ (IsFloor && floorBlocks != null && floorBlocks.Count != 0) || (!IsFloor && floorBlocks == null),
() => "isFloor=" + IsFloor + " floorBlocks=" + ToString(floorBlocks));
- if (Debugging.AssertsEnabled) Debugging.Assert(() => scratchBytes.GetFilePointer() == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(scratchBytes.GetFilePointer() == 0);
// TODO: try writing the leading vLong in MSB order
// (opposite of what Lucene does today), for better
@@ -495,12 +495,12 @@ namespace Lucene.Net.Codecs
scratchBytes.WriteVInt32(floorBlocks.Count);
foreach (PendingBlock sub in floorBlocks)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sub.FloorLeadByte != -1);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sub.FloorLeadByte != -1);
//if (DEBUG) {
// System.out.println(" write floorLeadByte=" + Integer.toHexString(sub.floorLeadByte&0xff));
//}
scratchBytes.WriteByte((byte)(sbyte)sub.FloorLeadByte);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => sub.Fp > Fp);
+ if (Debugging.AssertsEnabled) Debugging.Assert(sub.Fp > Fp);
scratchBytes.WriteVInt64((sub.Fp - Fp) << 1 | (uint)(sub.HasTerms ? 1 : 0));
}
}
@@ -508,7 +508,7 @@ namespace Lucene.Net.Codecs
ByteSequenceOutputs outputs = ByteSequenceOutputs.Singleton;
Builder<BytesRef> indexBuilder = new Builder<BytesRef>(FST.INPUT_TYPE.BYTE1, 0, 0, true, false, int.MaxValue, outputs, null, false, PackedInt32s.COMPACT, true, 15);
var bytes = new byte[(int)scratchBytes.GetFilePointer()];
- if (Debugging.AssertsEnabled) Debugging.Assert(() => bytes.Length > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(bytes.Length > 0);
scratchBytes.WriteTo(bytes, 0);
indexBuilder.Add(Util.ToInt32sRef(Prefix, scratchIntsRef), new BytesRef(bytes, 0, bytes.Length));
scratchBytes.Reset();
@@ -729,8 +729,8 @@ namespace Lucene.Net.Codecs
// in this block
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => lastSuffixLeadLabel == -1);
- Debugging.Assert(() => numSubs == 0);
+ Debugging.Assert(lastSuffixLeadLabel == -1);
+ Debugging.Assert(numSubs == 0);
}
suffixLeadLabel = -1;
}
@@ -742,7 +742,7 @@ namespace Lucene.Net.Codecs
else
{
PendingBlock block = (PendingBlock)ent;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => block.Prefix.Length > prefixLength);
+ if (Debugging.AssertsEnabled) Debugging.Assert(block.Prefix.Length > prefixLength);
suffixLeadLabel = block.Prefix.Bytes[block.Prefix.Offset + prefixLength] & 0xff;
}
@@ -863,7 +863,7 @@ namespace Lucene.Net.Codecs
//System.out.println(" = " + pendingCount);
pendingCount = 0;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => outerInstance.minItemsInBlock == 1 || subCount > 1, () => "minItemsInBlock=" + outerInstance.minItemsInBlock + " subCount=" + subCount + " sub=" + sub + " of " + numSubs + " subTermCount=" + subTermCountSums[sub] + " subSubCount=" + subSubCounts[sub] + " depth=" + prefixLength);
+ if (Debugging.AssertsEnabled) Debugging.Assert(outerInstance.minItemsInBlock == 1 || subCount > 1, () => "minItemsInBlock=" + outerInstance.minItemsInBlock + " subCount=" + subCount + " sub=" + sub + " of " + numSubs + " subTermCount=" + subTermCountSums[sub] + " subSubCount=" + subSubCounts[sub] + " depth=" + prefixLength);
subCount = 0;
startLabel = subBytes[sub + 1];
@@ -880,8 +880,8 @@ namespace Lucene.Net.Codecs
// here
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => startLabel != -1);
- Debugging.Assert(() => firstBlock != null);
+ Debugging.Assert(startLabel != -1);
+ Debugging.Assert(firstBlock != null);
}
prevTerm.Int32s[prevTerm.Offset + prefixLength] = startLabel;
//System.out.println(" final " + (numSubs-sub-1) + " subs");
@@ -902,7 +902,7 @@ namespace Lucene.Net.Codecs
prevTerm.Int32s[prevTerm.Offset + prefixLength] = savLabel;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => firstBlock != null);
+ if (Debugging.AssertsEnabled) Debugging.Assert(firstBlock != null);
firstBlock.CompileIndex(floorBlocks, outerInstance.scratchBytes);
pending.Add(firstBlock);
@@ -931,11 +931,11 @@ namespace Lucene.Net.Codecs
// block:
private PendingBlock WriteBlock(Int32sRef prevTerm, int prefixLength, int indexPrefixLength, int startBackwards, int length, int futureTermCount, bool isFloor, int floorLeadByte, bool isLastInFloor)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => length > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(length > 0);
int start = pending.Count - startBackwards;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => start >= 0, () => "pending.Count=" + pending.Count + " startBackwards=" + startBackwards + " length=" + length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(start >= 0, () => "pending.Count=" + pending.Count + " startBackwards=" + startBackwards + " length=" + length);
IList<PendingEntry> slice = pending.SubList(start, start + length);
@@ -994,7 +994,7 @@ namespace Lucene.Net.Codecs
subIndices = null;
foreach (PendingEntry ent in slice)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => ent.IsTerm);
+ if (Debugging.AssertsEnabled) Debugging.Assert(ent.IsTerm);
PendingTerm term = (PendingTerm)ent;
BlockTermState state = term.State;
int suffix = term.Term.Length - prefixLength;
@@ -1012,7 +1012,7 @@ namespace Lucene.Net.Codecs
statsWriter.WriteVInt32(state.DocFreq);
if (fieldInfo.IndexOptions != IndexOptions.DOCS_ONLY)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state.TotalTermFreq >= state.DocFreq, () => state.TotalTermFreq + " vs " + state.DocFreq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state.TotalTermFreq >= state.DocFreq, () => state.TotalTermFreq + " vs " + state.DocFreq);
statsWriter.WriteVInt64(state.TotalTermFreq - state.DocFreq);
}
@@ -1020,7 +1020,7 @@ namespace Lucene.Net.Codecs
outerInstance.postingsWriter.EncodeTerm(longs, bytesWriter, fieldInfo, state, absolute);
for (int pos = 0; pos < longsSize; pos++)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => longs[pos] >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(longs[pos] >= 0);
metaWriter.WriteVInt64(longs[pos]);
}
bytesWriter.WriteTo(metaWriter);
@@ -1055,7 +1055,7 @@ namespace Lucene.Net.Codecs
statsWriter.WriteVInt32(state.DocFreq);
if (fieldInfo.IndexOptions != IndexOptions.DOCS_ONLY)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => state.TotalTermFreq >= state.DocFreq);
+ if (Debugging.AssertsEnabled) Debugging.Assert(state.TotalTermFreq >= state.DocFreq);
statsWriter.WriteVInt64(state.TotalTermFreq - state.DocFreq);
}
@@ -1071,7 +1071,7 @@ namespace Lucene.Net.Codecs
outerInstance.postingsWriter.EncodeTerm(longs, bytesWriter, fieldInfo, state, absolute);
for (int pos = 0; pos < longsSize; pos++)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => longs[pos] >= 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(longs[pos] >= 0);
metaWriter.WriteVInt64(longs[pos]);
}
bytesWriter.WriteTo(metaWriter);
@@ -1085,13 +1085,13 @@ namespace Lucene.Net.Codecs
PendingBlock block = (PendingBlock)ent;
int suffix = block.Prefix.Length - prefixLength;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => suffix > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(suffix > 0);
// For non-leaf block we borrow 1 bit to record
// if entry is term or sub-block
suffixWriter.WriteVInt32((suffix << 1) | 1);
suffixWriter.WriteBytes(block.Prefix.Bytes, prefixLength, suffix);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => block.Fp < startFP);
+ if (Debugging.AssertsEnabled) Debugging.Assert(block.Fp < startFP);
// if (DEBUG) {
// BytesRef suffixBytes = new BytesRef(suffix);
@@ -1105,7 +1105,7 @@ namespace Lucene.Net.Codecs
}
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => subIndices.Count != 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(subIndices.Count != 0);
}
// TODO: we could block-write the term suffix pointers;
@@ -1184,7 +1184,7 @@ namespace Lucene.Net.Codecs
public override void FinishTerm(BytesRef text, TermStats stats)
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => stats.DocFreq > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(stats.DocFreq > 0);
//if (DEBUG) System.out.println("BTTW.finishTerm term=" + fieldInfo.name + ":" + toString(text) + " seg=" + segment + " df=" + stats.docFreq);
blockBuilder.Add(Util.ToInt32sRef(text, scratchIntsRef), noOutputs.NoOutput);
@@ -1206,12 +1206,12 @@ namespace Lucene.Net.Codecs
blockBuilder.Finish();
// We better have one final "root" block:
- if (Debugging.AssertsEnabled) Debugging.Assert(() => pending.Count == 1 && !pending[0].IsTerm, () => "pending.size()=" + pending.Count + " pending=" + pending);
+ if (Debugging.AssertsEnabled) Debugging.Assert(pending.Count == 1 && !pending[0].IsTerm, () => "pending.size()=" + pending.Count + " pending=" + pending);
PendingBlock root = (PendingBlock)pending[0];
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => root.Prefix.Length == 0);
- Debugging.Assert(() => root.Index.EmptyOutput != null);
+ Debugging.Assert(root.Prefix.Length == 0);
+ Debugging.Assert(root.Index.EmptyOutput != null);
}
this.sumTotalTermFreq = sumTotalTermFreq;
@@ -1237,9 +1237,9 @@ namespace Lucene.Net.Codecs
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => sumTotalTermFreq == 0 || fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY && sumTotalTermFreq == -1);
- Debugging.Assert(() => sumDocFreq == 0);
- Debugging.Assert(() => docCount == 0);
+ Debugging.Assert(sumTotalTermFreq == 0 || fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY && sumTotalTermFreq == -1);
+ Debugging.Assert(sumDocFreq == 0);
+ Debugging.Assert(docCount == 0);
}
}
}
diff --git a/src/Lucene.Net/Codecs/CodecUtil.cs b/src/Lucene.Net/Codecs/CodecUtil.cs
index 66980d9..f78b5b9 100644
--- a/src/Lucene.Net/Codecs/CodecUtil.cs
+++ b/src/Lucene.Net/Codecs/CodecUtil.cs
@@ -268,7 +268,7 @@ namespace Lucene.Net.Codecs
IndexInput clone = (IndexInput)input.Clone();
clone.Seek(0);
ChecksumIndexInput @in = new BufferedChecksumIndexInput(clone);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => @in.GetFilePointer() == 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(@in.GetFilePointer() == 0);
@in.Seek(@in.Length - FooterLength());
return CheckFooter(@in);
}
diff --git a/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsIndexWriter.cs b/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsIndexWriter.cs
index a87b918..21b7f25 100644
--- a/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsIndexWriter.cs
+++ b/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsIndexWriter.cs
@@ -106,7 +106,7 @@ namespace Lucene.Net.Codecs.Compressing
private void WriteBlock()
{
- if (Debugging.AssertsEnabled) Debugging.Assert(() => blockChunks > 0);
+ if (Debugging.AssertsEnabled) Debugging.Assert(blockChunks > 0);
fieldsIndexOut.WriteVInt32(blockChunks);
// The trick here is that we only store the difference from the average start
@@ -144,7 +144,7 @@ namespace Lucene.Net.Codecs.Compressing
for (int i = 0; i < blockChunks; ++i)
{
long delta = docBase - avgChunkDocs * i;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => PackedInt32s.BitsRequired(MoveSignToLowOrderBit(delta)) <= writer.BitsPerValue);
+ if (Debugging.AssertsEnabled) Debugging.Assert(PackedInt32s.BitsRequired(MoveSignToLowOrderBit(delta)) <= writer.BitsPerValue);
writer.Add(MoveSignToLowOrderBit(delta));
docBase += docBaseDeltas[i];
}
@@ -179,7 +179,7 @@ namespace Lucene.Net.Codecs.Compressing
{
startPointer += startPointerDeltas[i];
long delta = startPointer - avgChunkSize * i;
- if (Debugging.AssertsEnabled) Debugging.Assert(() => PackedInt32s.BitsRequired(MoveSignToLowOrderBit(delta)) <= writer.BitsPerValue);
+ if (Debugging.AssertsEnabled) Debugging.Assert(PackedInt32s.BitsRequired(MoveSignToLowOrderBit(delta)) <= writer.BitsPerValue);
writer.Add(MoveSignToLowOrderBit(delta));
}
writer.Finish();
@@ -197,7 +197,7 @@ namespace Lucene.Net.Codecs.Compressing
{
firstStartPointer = maxStartPointer = startPointer;
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => firstStartPointer > 0 && startPointer >= firstStartPointer);
+ if (Debugging.AssertsEnabled) Debugging.Assert(firstStartPointer > 0 && startPointer >= firstStartPointer);
docBaseDeltas[blockChunks] = numDocs;
startPointerDeltas[blockChunks] = startPointer - maxStartPointer;
diff --git a/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsReader.cs b/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsReader.cs
index b741c66..e657a6f 100644
--- a/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsReader.cs
+++ b/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsReader.cs
@@ -101,7 +101,7 @@ namespace Lucene.Net.Codecs.Compressing
indexStream = d.OpenChecksumInput(indexStreamFN, context);
string codecNameIdx = formatName + CompressingStoredFieldsWriter.CODEC_SFX_IDX;
version = CodecUtil.CheckHeader(indexStream, codecNameIdx, CompressingStoredFieldsWriter.VERSION_START, CompressingStoredFieldsWriter.VERSION_CURRENT);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => CodecUtil.HeaderLength(codecNameIdx) == indexStream.GetFilePointer());
+ if (Debugging.AssertsEnabled) Debugging.Assert(CodecUtil.HeaderLength(codecNameIdx) == indexStream.GetFilePointer());
indexReader = new CompressingStoredFieldsIndexReader(indexStream, si);
long maxPointer = -1;
@@ -140,7 +140,7 @@ namespace Lucene.Net.Codecs.Compressing
{
throw new CorruptIndexException("Version mismatch between stored fields index and data: " + version + " != " + fieldsVersion);
}
- if (Debugging.AssertsEnabled) Debugging.Assert(() => CodecUtil.HeaderLength(codecNameDat) == fieldsStream.GetFilePointer());
+ if (Debugging.AssertsEnabled) Debugging.Assert(CodecUtil.HeaderLength(codecNameDat) == fieldsStream.GetFilePointer());
if (version >= CompressingStoredFieldsWriter.VERSION_BIG_CHUNKS)
{
@@ -335,8 +335,8 @@ namespace Lucene.Net.Codecs.Compressing
{
if (Debugging.AssertsEnabled)
{
- Debugging.Assert(() => chunkSize > 0);
- Debugging.Assert(() => offset < chunkSize);
+ Debugging.Assert(chunkSize > 0);
+ Debugging.Assert(offset < chunkSize);
}
decompressor.Decompress(fieldsStream, chunkSize, offset, Math.Min(length, chunkSize - offset), bytes);
@@ -346,7 +346,7 @@ namespace Lucene.Net.Codecs.Compressing
{
BytesRef bytes = totalLength <= BUFFER_REUSE_THRESHOLD ? this.bytes : new BytesRef();
decompressor.Decompress(fieldsStream, totalLength, offset, length, bytes);
- if (Debugging.AssertsEnabled) Debugging.Assert(() => bytes.Length == length);
+ if (Debugging.AssertsEnabled) Debugging.Assert(bytes.Length == length);
documentInput = new ByteArrayDataInput(bytes.Bytes, bytes.Offset, bytes.Length);
}
@@ -357,7 +357,7 @@ namespace Lucene.Net.Codecs.Compressing
FieldInfo fieldInfo = fieldInfos.FieldInfo(fieldNumber);
int bits = (int)(infoAndBits & CompressingStoredFieldsWriter.TYPE_MASK);
... 11941 lines suppressed ...