-
Notifications
You must be signed in to change notification settings - Fork 276
Avoid illegal reflective operation during startup #1313
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a0a1340 to
11d3630
Compare
Codecov Report
@@ Coverage Diff @@
## master #1313 +/- ##
==========================================
- Coverage 77.62% 77.56% -0.07%
==========================================
Files 144 144
Lines 10141 10152 +11
Branches 406 406
==========================================
+ Hits 7872 7874 +2
- Misses 2269 2278 +9
|
We now require the plugin to supply a manifest entry for the "Main-Class" attribute, this is used to load the plugin without doing illegal reflection operations. We also get rid of the dependency org.clapper.classutil.
11d3630 to
97843fa
Compare
pm47
reviewed
Feb 27, 2020
97843fa to
056e269
Compare
pm47
reviewed
Feb 28, 2020
89202a2 to
6748cfa
Compare
Contributor
Author
|
The PR has been updated to not apply any change regarding the version checks of the plugins. |
6748cfa to
9d48631
Compare
pm47
approved these changes
Feb 28, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR rewords the way we load plugins providing a stricter and safer way to load them. We now require plugins to exhibit a MANIFEST file with some well defined entries:-Main-Classto identify the plugin entry point ( class implementingPlugin)-X-Eclair-Supported-Versionscontains a list of all supported eclair versionTheMain-Classis mainly used to load the plugin without scanning usingorg.clapper.classutils, this allows us to avoid an illegal reflective call during startup. The list of supported version allows us to check if the plugin we're loading supports the current version of eclair, this prevents from running outdated (and incompatible) plugins.This PR slightly reworks the way we load plugins to avoid doing an illegal reflective call. Instead of using org.clapper.classutils to scan for classes (and perform the illegal reflective call) we now require the plugin to tell us which class is implementing the Plugin interface via MANIFEST file.