-
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
Reduce class/member visibility of all normalizer and stemmer classes [LUCENE-10561] #11597
Comments
Robert Muir (@rmuir) (migrated from JIRA) you can just make the entire classes package private. there are probably a ton of stemmer classes in the same situation. only the tokenstream(factory) need be public. |
Rushabh Shah (@shahrs87) (migrated from JIRA) Hi,
I understand that I need to update checksum somewhere but don't know whether we have some script that does that or we have to compute manually. Please advise. |
Robert Muir (@rmuir) (migrated from JIRA) Some of the tokenizers are auto-generated. For example ClassicTokenizerImpl is generated by "jflex" tool from ClassicTokenizer.jflex sources. |
Rushabh Shah (@shahrs87) (migrated from JIRA) Thank you @rmuir for the comment. I have updated the PR as per your suggestions. Please review. |
Rushabh Shah (@shahrs87) (migrated from JIRA) @rmuir Also can you please assign the Jira to me. |
Robert Muir (@rmuir) (migrated from JIRA) I think i didn't explain my suggestion well enough. When i said "make entire classes package private", I mean that, for example, ArabicNormalizer does not need to be public class anymore. I think this is easier than modifying many individual constants. Some of the constants modified in the PR are not related to stemmers/normalizers and may cause problems. Generally speaking, public constants are harmless, so I don't think there is much benefit in hiding them. But entire classes that need not be public, that is worth fixing because it clutters up javadoc and API for no good reason. |
Rushabh Shah (@shahrs87) (migrated from JIRA) Thank you @rmuir for the clarification. One followup question. Should I change only the classes that are Normalizer or Stemmer in this PR and not touch other classes ? |
Tomoko Uchida (@mocobeta) (migrated from JIRA)
I don't think we can assign external contributors. Don't worry about it - it's not so important thing; A CHANGE entry is sufficient for us to track who changes it.
|
Tomoko Uchida (@mocobeta) (migrated from JIRA)
There are some public static constants their type is Array - |
Tomoko Uchida (@mocobeta) (migrated from JIRA)
I'd agree with that. It'd be better not to touch Tokenizer/TokenFilters in this issue. It's another issue and changing them will break users' code; we'd need to be careful about it. |
Tomoko Uchida (@mocobeta) (migrated from JIRA) (So... we need to switch Jira/GitHub even such a relatively small issue, and conversation is scattered over both of them. This is a good motivation for #11593 to me.) |
ASF subversion and git services (migrated from JIRA) Commit 694d797 in lucene's branch refs/heads/main from Rushabh Shah LUCENE-10561 Reduce class/member visibility of all normalizer and stemmer classes (#883) Co-authored-by: Rushabh Shah <shahrs87@apache.org> |
This is a spin-off of #11348.
Constants and methods in those classes are exposed to the outside packages; we should be able to limit the visibility to
private
or, at least topackage private
.This change breaks backward compatibility so should be applied to the main branch (10.0) only, and a MIGRATE entry may be needed.
Also, they seem unchanged since 2008, we could refactor them to embrace newer Java APIs as we did in #540.
Migrated from LUCENE-10561 by Tomoko Uchida (@mocobeta), resolved May 14 2022
Linked issues:
Pull requests: #883
The text was updated successfully, but these errors were encountered: