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
Issue #5830 Remove com.sun.nio.file import. #5838
Issue #5830 Remove com.sun.nio.file import. #5838
Conversation
This is acheived by using the 3-arg Class.forName() method call. The bnd tool which generates the osgi manifests doesn't seem to include Import-Package statements for the 3-arg method call, but does for the 1-arg method call. The speculative loading of the com.sun.nio.file.SensitivityWatchEventModifier will probably be removed in jetty-10 onwards. Signed-off-by: Jan Bartel <janb@webtide.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 - this is a simple enough fix.
note it's a |
@olamy I thought of that, but decided not to use it because a) every time I've put in special bnd voodoo it comes back later to bite us on the ass in unexpected ways b) if sometime in the future we added a class that actually wanted the class.forname discovered then by then we would probably have forgotten all about the special flag we added and waste a lot of time diagnosing the problem C) the class.forname in question is going to be deleted on jetty 10 anyway so no point polluting the bnd args for it. |
Signed-off-by: Jan Bartel <janb@webtide.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #5830
The bnd tool which generates the osgi manifest for jetty-util is including an
Import-Package
forcom.sun.nio.file
, even though this class is only speculatively loaded (ie it is not mandatory for it to be present).By using the 3-arg Class.forName(String name, boolean initialize, ClassLoader loader) method call, we can get bnd to ignore this package.
BTW: the speculative loading of the com.sun.nio.file.SensitivityWatchEventModifier will probably be removed in jetty-10 onwards, as will any references in jetty-util module-info.java.