Skip to content

Add support for importing java.* packages for OSGi Core R7 #4241

Merged
bjhargrave merged 3 commits into
bndtools:masterfrom
bjhargrave:issues/2507
Jul 30, 2020
Merged

Add support for importing java.* packages for OSGi Core R7 #4241
bjhargrave merged 3 commits into
bndtools:masterfrom
bjhargrave:issues/2507

Conversation

@bjhargrave

Copy link
Copy Markdown
Member

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>
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>
@lgtm-com

lgtm-com Bot commented Jul 30, 2020

Copy link
Copy Markdown

This pull request fixes 1 alert when merging e12204d into 2df1dbc - view on LGTM.com

fixed alerts:

  • 1 for Arbitrary file write during archive extraction ("Zip Slip")

@bjhargrave bjhargrave merged commit d538548 into bndtools:master Jul 30, 2020
@bjhargrave bjhargrave deleted the issues/2507 branch July 30, 2020 21:28
@pkriens

pkriens commented Jul 31, 2020

Copy link
Copy Markdown
Member

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.

@bjhargrave

bjhargrave commented Jul 31, 2020

Copy link
Copy Markdown
Member Author

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 -noee instruction to opt-out.

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.

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

Successfully merging this pull request may close these issues.

OSGi Java 9 support: Importing java.* packages

2 participants