uschindler opened a new pull request #298: URL: https://github.com/apache/lucene/pull/298
Before creating a pull request, please file an issue in the ASF Jira system for Lucene: * https://issues.apache.org/jira/browse/LUCENE-10101 # Description This PR changes the AnalyisSPILoader's method to lookup the `NAME` field of the SPI to use `Class#getField()` instead of `Class#getDeclaredField()`. This does not require special security privileges if the class is in a related classloader. As `getField()` unfortunately also looks into superclass if the field is not found, the checks for validness of the field have to be changed to check the declaring class. In contrast, the public check is obsolete, as only public fields are returned. # Tests Testing is hard, as our security policy of tests allows to do declared member access. So no test will be added. Testing will be done by Elasticsearch people (@romseygeek). # Checklist Please review the following and check all that apply: - [X] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/lucene/HowToContribute) and my code conforms to the standards described there to the best of my ability. - [X] I have created a Jira issue and added the issue ID to my pull request title. - [-] I have given Lucene maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended) - [X] I have developed this patch against the `main` branch. - [X] I have run `./gradlew check`. - [-] I have added tests for my changes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
