-
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
Remove redundant field initializers #13060
Conversation
In many cases this allowed to mark the field as `final`
@@ -32,10 +32,10 @@ | |||
*/ | |||
public final class DaitchMokotoffSoundexFilter extends TokenFilter { | |||
/** true if encoded tokens should be added as synonyms */ | |||
protected boolean inject = true; | |||
final boolean inject; |
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.
I would make these fields private
, but not sure if breaking backward compatibility here would be ok?
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.
Since this class is marked with @lucene.experimental
, we can make the change.
@@ -32,13 +32,13 @@ | |||
*/ | |||
public final class PhoneticFilter extends TokenFilter { | |||
/** true if encoded tokens should be added as synonyms */ | |||
protected boolean inject = true; | |||
final boolean inject; |
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.
Could be changed to private
too?
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.
It's a strange case. We're not really breaking backwards compatibility, since no one could have accessed this field anyway with the class being final.
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution! |
Make protected fields in final classes private.
In many cases this allowed to mark the field as
final
.