-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Convert IOContext, MergeInfo, and FlushInfo to record classes #13205
Conversation
I needed to change some consumers to call the getter methods instead of accessing fields (which are now hidden). |
We should possibly convert other classes to records, too (like FlushInfo or MergeInfo if they are immutable). |
I had to fix the missing-doclet javadoc parser to understand records. The easy fix was to treat them as "classes". |
I also converted the MergeInfo and FlushInfo classes to records. Very clean now. |
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.
thanks for fixing the missing-doclet to deal with records!
This was a requirement, because building Javadocs failed without that fix. It is really nice that the code throws an exception when it hits an unknown element! |
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.
Much nicer!
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.
LGTM
# Conflicts: # lucene/core/src/java/org/apache/lucene/store/IOContext.java
Hi @ChrisHegarty, Luckily @jpountz opened #13211, can't wait to see this be resolved. |
The record constructor checks, while not pretty, seem right to me. This is a nice cleanup and somewhat easier to reason about. |
Followup to #13204: This converts IOContext to a record class. This has several positive effects:
The IOContext has some crazy constructors, I left them in, but all have to delegate to the default constructor now.