Commit 3681fe1
* Avoid unnecessary FileInfo/DirectoryInfo allocations, #832
* Remove extra semicolon in WriteLineDocTask.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Enable NRT on StopAnalyzer and StopwordAnalyzerBase
* Add comments about parameter normalization
* Revert FileInfo change in CompoundFileExtractor (while leaving null check)
* Add string-based constructor tests for FilesystemResourceLoader
Added comprehensive tests for the new string-based constructors in FilesystemResourceLoader:
- TestBaseDirWithString: Tests string path instead of DirectoryInfo
- TestDelegationWithString: Tests delegation with string base directory
- TestRelativePathsWithString: Tests various relative path scenarios
- TestRelativePathsWithStringAndDelegation: Tests relative paths with delegation fallback
These tests ensure the string-based constructors work correctly alongside the existing DirectoryInfo-based ones.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add comprehensive tests for string-based overloads (Issue #832)
Added tests for the new string-based constructors and methods that avoid unnecessary FileInfo/DirectoryInfo allocations:
StopAnalyzer Tests:
- TestStopAnalyzerWithStringFileName: Tests string-based constructor with absolute paths
- TestStopAnalyzerWithRelativePath: Tests string-based constructor with relative paths
- TestLoadStopwordSetWithStringPath: Tests StopwordAnalyzerBase.LoadStopwordSet(string, LuceneVersion)
FilesystemResourceLoader Tests:
- TestNestedRelativePathsWithString: Tests nested relative paths with string-based constructors
FileUtils Tests:
- TestFullyDeleteWithStringPath: Tests FullyDelete(string) with absolute paths
- TestFullyDeleteNonExistentStringPath: Tests behavior with non-existent paths
- TestFullyDeleteWithDirectoryInfo: Tests original DirectoryInfo overload
- TestFullyDeleteEmptyDirectoryWithStringPath: Tests with empty directories
- TestFullyDeleteWithRelativeStringPath: Tests with relative paths
All tests ensure the new string-based overloads work correctly with both absolute and relative paths.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add SystemEnvironment lock for thread-safe Environment.CurrentDirectory changes
Created SystemEnvironment helper class in TestFramework to prevent race conditions when tests
that modify Environment.CurrentDirectory run in parallel. This addresses potential issues
identified during the string-based overload additions (Issue #832).
Changes:
- Added SystemEnvironment.cs with thread-safe lock mechanism using SemaphoreSlim
- Provides WithCurrentDirectory methods that automatically restore the original directory
- Updated all tests that change Environment.CurrentDirectory to use SystemEnvironment:
* TestStopAnalyzer.TestStopAnalyzerWithRelativePath
* TestFilesystemResourceLoader (multiple methods)
* TestFileUtils.TestFullyDeleteWithRelativeStringPath
* TestStreamUtils (input/output stream tests)
* TestIOUtils.TestGetDecodingReaderWithRelativePath
* TestWriteEnwikiLineDocTask.TestCategoriesLineFileWithRelativePath
This ensures tests can safely run in parallel without interfering with each other's
current directory state.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix whitespace: Add final newlines to source files
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix Windows test failures: Use platform-aware path separators
- Use Path.Combine in test assertions to ensure correct path separators
- Remove Unix-style absolute paths starting with slash
- Add platform-specific absolute path tests for Windows and Unix
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix path separator issues: Use Path.Combine for platform compatibility
- Replace hardcoded path separators with Path.Combine
- Ensures correct separators on both Windows and Unix
- Fixes test failures on Windows
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
1 parent b34c8f6 commit 3681fe1
43 files changed
Lines changed: 1660 additions & 168 deletions
File tree
- src
- Lucene.Net.Analysis.Common/Analysis
- Compound
- Hyphenation
- Core
- Util
- Lucene.Net.Analysis.Kuromoji
- Dict
- Tools
- Lucene.Net.Analysis.SmartCn
- Hhmm
- Lucene.Net.Benchmark
- ByTask
- Feeds
- Tasks
- Utils
- Quality/Trec
- Lucene.Net.Misc/Index
- Lucene.Net.Suggest
- Spell
- Suggest/Jaspell
- Lucene.Net.TestFramework/Support
- Configuration
- Util
- Lucene.Net.Tests.Analysis.Common/Analysis
- Core
- Util
- Lucene.Net.Tests.Benchmark/ByTask
- Tasks
- Utils
- Lucene.Net.Tests/Util
- Lucene.Net
- Store
- Util
- Fst
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
Lines changed: 4 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 130 | + | |
133 | 131 | | |
134 | 132 | | |
135 | 133 | | |
| |||
149 | 147 | | |
150 | 148 | | |
151 | 149 | | |
152 | | - | |
153 | | - | |
154 | | - | |
| 150 | + | |
155 | 151 | | |
156 | 152 | | |
157 | 153 | | |
| |||
160 | 156 | | |
161 | 157 | | |
162 | 158 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 159 | + | |
167 | 160 | | |
168 | 161 | | |
169 | 162 | | |
170 | 163 | | |
171 | 164 | | |
172 | 165 | | |
173 | 166 | | |
174 | | - | |
175 | | - | |
176 | | - | |
| 167 | + | |
177 | 168 | | |
178 | 169 | | |
179 | 170 | | |
| |||
Lines changed: 3 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 83 | + | |
86 | 84 | | |
87 | 85 | | |
88 | 86 | | |
| |||
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 104 | + | |
109 | 105 | | |
110 | 106 | | |
111 | 107 | | |
| |||
114 | 110 | | |
115 | 111 | | |
116 | 112 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 113 | + | |
123 | 114 | | |
124 | 115 | | |
125 | 116 | | |
| |||
Lines changed: 5 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 134 | + | |
137 | 135 | | |
138 | 136 | | |
139 | 137 | | |
| |||
143 | 141 | | |
144 | 142 | | |
145 | 143 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 144 | + | |
149 | 145 | | |
150 | 146 | | |
151 | 147 | | |
| |||
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
157 | | - | |
158 | | - | |
159 | | - | |
| 153 | + | |
160 | 154 | | |
161 | 155 | | |
162 | 156 | | |
| |||
166 | 160 | | |
167 | 161 | | |
168 | 162 | | |
169 | | - | |
170 | | - | |
171 | | - | |
| 163 | + | |
172 | 164 | | |
173 | 165 | | |
174 | 166 | | |
| |||
177 | 169 | | |
178 | 170 | | |
179 | 171 | | |
180 | | - | |
181 | | - | |
182 | | - | |
| 172 | + | |
183 | 173 | | |
184 | 174 | | |
185 | 175 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
80 | 95 | | |
81 | 96 | | |
82 | 97 | | |
| |||
Lines changed: 43 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
65 | 92 | | |
66 | 93 | | |
67 | 94 | | |
68 | 95 | | |
69 | 96 | | |
70 | 97 | | |
71 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
72 | 104 | | |
73 | 105 | | |
74 | 106 | | |
75 | | - | |
| 107 | + | |
76 | 108 | | |
77 | 109 | | |
78 | 110 | | |
| |||
89 | 121 | | |
90 | 122 | | |
91 | 123 | | |
92 | | - | |
| 124 | + | |
93 | 125 | | |
94 | 126 | | |
95 | 127 | | |
96 | 128 | | |
97 | | - | |
| 129 | + | |
98 | 130 | | |
99 | 131 | | |
100 | 132 | | |
101 | 133 | | |
102 | 134 | | |
103 | 135 | | |
104 | 136 | | |
105 | | - | |
| 137 | + | |
106 | 138 | | |
107 | 139 | | |
108 | 140 | | |
109 | 141 | | |
110 | | - | |
| 142 | + | |
111 | 143 | | |
112 | 144 | | |
113 | | - | |
| 145 | + | |
114 | 146 | | |
115 | 147 | | |
116 | 148 | | |
117 | 149 | | |
118 | 150 | | |
119 | 151 | | |
120 | | - | |
| 152 | + | |
121 | 153 | | |
122 | 154 | | |
123 | 155 | | |
| |||
Lines changed: 32 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | | - | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
107 | 136 | | |
108 | 137 | | |
109 | 138 | | |
| |||
118 | 147 | | |
119 | 148 | | |
120 | 149 | | |
121 | | - | |
| 150 | + | |
122 | 151 | | |
123 | 152 | | |
124 | 153 | | |
| |||
0 commit comments