Add support for importing java.* packages for OSGi Core R7 #4241
Conversation
Signed-off-by: BJ Hargrave <bj@bjhargrave.com>
Signed-off-by: BJ Hargrave <bj@bjhargrave.com>
This can be disabled with `-noimportjava: true`. The support allows control over the specific java packages imported via the Import-Package instruction. The support is only enabled if either the bundle imports the `org.osgi.framework` package at version 1.9 (Core R7), or higher, or if the bundle includes class files for Java 11, or higher. Fixes #2507 Signed-off-by: BJ Hargrave <bj@bjhargrave.com>
|
This pull request fixes 1 alert when merging e12204d into 2df1dbc - view on LGTM.com fixed alerts:
|
|
I had not noticed that we now import java. Was it discussed to so drastically change the default? In my case we compare bundles against a previous release and only update when needed. This is creating a massive change. I think the default should be as it always ways and then an opt-in. |
|
Yes, it was discussed at length in #2507. I went with the consensus decision from that discussion albeit with some tweaks. This is in some way parallel to when we automatically added osgi.ee requirements with the If we want to tweak how and when we want to import java.* packages, we should probably open a new issue to discuss. This PR is already merged. |
This can be disabled with
-noimportjava: true. The support allowscontrol over the specific java packages imported via the
Import-Packageinstruction. The support is only enabled if either the bundle imports
the
org.osgi.frameworkpackage at version 1.9 (Core R7), or higher, orif the bundle includes class files for Java 11, or higher.
Fixes #2507