From 2cf2a38dc2df6ffde4458503a4ca960b9c097b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Fri, 5 Jan 2024 14:58:28 +0100 Subject: [PATCH] Make import to internal sun classes and the annotations optional the sun.* classes are internal depending on the jvm settings especially the 'sun.nio.ch', this currently makes the lib unusable in its provided form without special configuration. As the sun.nio.ch is actually optional (it is only used after instanceof checks) it could be marked optional import in the manifest so it is sued whenever the jvm provides the package and otherwise will not be used at all. Also the annotations import is actually optional as the code does not reference it anywhere except as an annotation on methods/classes so the absence will just make the annotations invisible on runtime if not provided. Beside that, it is actually a split package and therefore needs to mention the bundle it wants to import the package from. This changes all sun.* packages to optional as well as the javax.annotation package and additionally mentions the bundle it wants to import the annotations from. --- pom.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f07e2d4..7dc4aa5 100644 --- a/pom.xml +++ b/pom.xml @@ -279,8 +279,15 @@ !java.*, !sun.* - !java.*,!sun.* - * + + !java.*, + !sun.* + + + javax.annotation;resolution:=optional;bundle-symbolic-name="${@bundlesymbolicname}", + sun.*;resolution:=optional, + * +