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

Is pf4j.ignoreExtensionPoint supposed to work with abstract ExtensionPoint? #369

Closed
GunoH opened this issue Mar 10, 2020 · 5 comments
Closed

Comments

@GunoH
Copy link
Contributor

GunoH commented Mar 10, 2020

Hi,

Using an abstract class as extension point, which does not implement org.pf4j.ExtensionPoint (combined with the compiler arg -Apf4j.ignoreExtensionPoint that was added for #350), gives me the following compilation error:
Error:(32,8) java: com.foo.MyExtension is not an extension (it doesn't implement any interface)

According to the pf4j docs, an extension point can either be an interface or an abstract class. Therefore I do not agree with the error message; MyExtension is an extension, because it extends an extension point (which happens to be an abstract class instead of an interface). So it should just work :-)

Am I missing something here? Is this supposed to work? Could this be a bug in pf4j?

Thanks,
Guno

@decebals
Copy link
Member

@GunoH
Take a look on #358.
I created already a PR (#360) to solve some of the issues discussed in #358 but I think that it's not too much interest for this PR.

@GunoH
Copy link
Contributor Author

GunoH commented Mar 10, 2020

Thanks. I agree. Don't think #360 will help much for the issue I'm having.

I can see why it could be difficult to determine from ExtensionAnnotationProcessor#findExtensionPoints which of MyExtension's super classes would be the actual extension point, so I'm not counting on a fix for that soon.

The error message could be improved a bit though, because it made me doubt whether using an abstract class as extension point was supported by pf4j in the first place. Maybe something like "Cannot use %s as extension point with %s compiler arg (it doesn't implement any interface)", extensionElement, IGNORE_EXTENSION_POINT. Should I add a PR for that?

@decebals
Copy link
Member

Should I add a PR for that?

Yes. Please add a PR.

@decebals
Copy link
Member

@GunoH
Can we close this issue?

@GunoH
Copy link
Contributor Author

GunoH commented Mar 19, 2020

Yes, let's close it.

@GunoH GunoH closed this as completed Mar 19, 2020
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