Skip to content
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

It should not return null after it detects that the plugin has been loaded #218

Closed
JiaRG opened this issue May 14, 2018 · 3 comments
Closed

Comments

@JiaRG
Copy link

JiaRG commented May 14, 2018


If null is returned, a null pointer exception will occur here
return pluginWrapper.getDescriptor().getPluginId();

Should the return loaded PluginWrapper using getPlugin(String pluginId) method?

@decebals
Copy link
Member

decebals commented May 14, 2018

I understand what you say, but if we do the modifications according to your recommendation (return PluginWrapper in loadPluginFromPath when someone try to load a plugin multiple time), we don't have a "real" feedback if we loaded or not the plugin from path. The result is the same if you load a new plugin from a disk path or you tried to load a plugin multiple times.
What about if we throw a PluginException with the message "Plugin '{}' already loaded with id '{}'", pluginPath, pluginId?
Also, I am curios to know other opinions from other people.

@JiaRG
Copy link
Author

JiaRG commented May 14, 2018

Well, I agree with you and throw a PluginException, such as RepeatLoadPluginException.

@decebals
Copy link
Member

I added PluginAlreadyLoadedException.
We can evolve this PluginException hierarchy and add other subclasses like: PluginNotFoundException, InvalidPlugin(Descriptor)Extension, ...
I don't know, it can be a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants