-
Notifications
You must be signed in to change notification settings - Fork 139
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
Use Import-Package instead of Require-Bundle for o.e.c.runtime to prevent importing unnecessary classes #3375
base: master
Are you sure you want to change the base?
Use Import-Package instead of Require-Bundle for o.e.c.runtime to prevent importing unnecessary classes #3375
Conversation
@@ -6,6 +6,16 @@ Bundle-Version: 3.40.100.qualifier | |||
Bundle-Activator: org.eclipse.jdt.core.JavaCore | |||
Bundle-Vendor: %providerName | |||
Bundle-Localization: plugin | |||
Import-Package: org.eclipse.core.internal.runtime, |
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.
why importing an internal package?
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.
Also why are these imported without a version constraint?
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.
why importing an internal package?
The use of internal packages was not introduced by this PR; it originates from existing code in jdt.core, which already references these internal packages.
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.
Also why are these imported without a version constraint?
A version constraint was added in last revision of this PR.
By arguing this PR affect your project you imply that the require-bundle silently is some public API. APIs should not be changed. I do not understand what exactly is going on there, but i have doubts that this is the right way to fix it. |
Both |
@@ -6,6 +6,16 @@ Bundle-Version: 3.40.100.qualifier | |||
Bundle-Activator: org.eclipse.jdt.core.JavaCore | |||
Bundle-Vendor: %providerName | |||
Bundle-Localization: plugin | |||
Import-Package: org.eclipse.core.internal.runtime, |
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.
Based on discussion at eclipse-equinox/equinox#697 , it looks like we can add ;bundle-symbolic-name="org.eclipse.core.runtime";bundle-version="[3.29.0, 4.0)"
to each Import-Package to keep some versioning.
…vent importing unnecessary classes
f04b14f
to
5787754
Compare
What it does
Based on the discussion in eclipse-equinox/equinox#697 (comment), using
Require-Bundle
fororg.eclipse.core.runtime
will pull in all oforg.eclipse.osgi
which in-turn exposes you to all the JDK packages because this horrible re-export:https://github.com/eclipse-platform/eclipse.platform/blob/6dd67323474b1b49d541bcd1e4ea8007ab2a36a4/runtime/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF#L12C17-L12C87.
In our downstream project, we try to override some part of JRE packages within our fragment of
org.eclipse.jdt.core
. However, the default JDK packages always take precedence because of thisRequire-Bundle
thing. The equinox team's recommendation is to useImport-Package
instead ofRequire-Bundle
for finer control over the imported classes.How to test
This PR just minimizes the imported packages from the bundle
o.e.c.runtime
, without affecting the overall functionality of the feature.