-
Notifications
You must be signed in to change notification settings - Fork 915
Cleanup parsing.lucene module and fix deprecations #8590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
da56a2c to
2eeaf73
Compare
matthiasblaesing
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks sane to me. I don't agree with everything (for example String#format is in my eyes much more readable than its hot new cousing String#formatted), but I think this is still an improvement.
However at at least one location (see inline comment), I think the API switch changed semantics of the code.
ide/parsing.lucene/src/org/netbeans/modules/parsing/lucene/MemoryIndex.java
Show resolved
Hide resolved
2eeaf73 to
52955b6
Compare
ide/parsing.lucene/src/org/netbeans/modules/parsing/lucene/MemoryIndex.java
Outdated
Show resolved
Hide resolved
lkishalmi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be fine.
|
thanks for reviews, I want to simplify the |
- all lucene deprecations fixed - javac warnings fixed - JDK 17 language level and other cleanup
11de9da to
0e567c7
Compare
| if (reader != null) { | ||
| final IndexReader newReader = IndexReader.openIfChanged(reader); | ||
| IndexReader newReader = IndexReader.openIfChanged(reader); | ||
| if (newReader != null) { | ||
| reader.close(); | ||
| reader = newReader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both impls are now the same, this is LuceneIndex
| if (cachedReader != null) { | ||
| final IndexReader newReader = cachedReader.reopen(); | ||
| if (newReader != cachedReader) { | ||
| IndexReader newReader = IndexReader.openIfChanged(cachedReader); | ||
| if (newReader != null) { | ||
| cachedReader.close(); | ||
| cachedReader = newReader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for MemoryIndex
Lucene 4.0 breaks API which makes an upgrade a bit tricky since not much builds after that. This moves some of the work to 3.6.2 while tests are still working as attempt to make #8384 easier.