|
1 | 1 | using J2N.Threading;
|
2 | 2 | using J2N.Threading.Atomic;
|
3 | 3 | using Lucene.Net.Analysis;
|
| 4 | +using Lucene.Net.Codecs; |
| 5 | +using Lucene.Net.Codecs.Lucene40; |
4 | 6 | using Lucene.Net.Diagnostics;
|
5 | 7 | using Lucene.Net.Documents;
|
6 | 8 | using Lucene.Net.Index.Extensions;
|
@@ -699,7 +701,7 @@ public override void Eval(MockDirectoryWrapper dir)
|
699 | 701 | // which will always be true if the first case is true. The name of the variable implies it checking for "Append"
|
700 | 702 | // but that is not a method on FreqProxTermsWriterPerField.
|
701 | 703 | bool sawAppend = StackTraceHelper.DoesStackTraceContainMethod(nameof(FreqProxTermsWriterPerField), nameof(FreqProxTermsWriterPerField.Flush));
|
702 |
| - bool sawFlush = StackTraceHelper.DoesStackTraceContainMethod("Flush"); |
| 704 | + bool sawFlush = StackTraceHelper.DoesStackTraceContainMethod(nameof(FreqProxTermsWriterPerField.Flush)); |
703 | 705 |
|
704 | 706 | if (sawAppend && sawFlush && count++ >= 30)
|
705 | 707 | {
|
@@ -1810,7 +1812,7 @@ public override IndexInput OpenInput(string name, IOContext context)
|
1810 | 1812 | // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
|
1811 | 1813 | if (doFail
|
1812 | 1814 | && name.StartsWith("segments_", StringComparison.Ordinal)
|
1813 |
| - && StackTraceHelper.DoesStackTraceContainMethod("Read")) |
| 1815 | + && StackTraceHelper.DoesStackTraceContainMethod(nameof(SegmentInfos.Read))) |
1814 | 1816 | {
|
1815 | 1817 | throw UnsupportedOperationException.Create("expected UOE");
|
1816 | 1818 | }
|
@@ -2349,9 +2351,9 @@ public override void Eval(MockDirectoryWrapper dir)
|
2349 | 2351 |
|
2350 | 2352 | // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
|
2351 | 2353 | // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
|
2352 |
| - bool sawSeal = StackTraceHelper.DoesStackTraceContainMethod("SealFlushedSegment"); |
2353 |
| - bool sawWrite = StackTraceHelper.DoesStackTraceContainMethod("WriteLiveDocs") |
2354 |
| - || StackTraceHelper.DoesStackTraceContainMethod("WriteFieldUpdates"); |
| 2354 | + bool sawSeal = StackTraceHelper.DoesStackTraceContainMethod(nameof(DocumentsWriterPerThread.SealFlushedSegment)); |
| 2355 | + bool sawWrite = StackTraceHelper.DoesStackTraceContainMethod(nameof(Lucene40LiveDocsFormat.WriteLiveDocs)) |
| 2356 | + || StackTraceHelper.DoesStackTraceContainMethod(nameof(ReadersAndUpdates.WriteFieldUpdates)); |
2355 | 2357 |
|
2356 | 2358 | // Don't throw exc if we are "flushing", else
|
2357 | 2359 | // the segment is aborted and docs are lost:
|
@@ -2527,7 +2529,7 @@ public override void Eval(MockDirectoryWrapper dir)
|
2527 | 2529 | {
|
2528 | 2530 | // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
|
2529 | 2531 | // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
|
2530 |
| - bool maybeFail = StackTraceHelper.DoesStackTraceContainMethod("RollbackInternal"); |
| 2532 | + bool maybeFail = StackTraceHelper.DoesStackTraceContainMethod(nameof(IndexWriter.RollbackInternal)); |
2531 | 2533 |
|
2532 | 2534 | if (maybeFail && Random.Next(10) == 0)
|
2533 | 2535 | {
|
|
0 commit comments