Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344962 - org.eclipse.equinox.io is in the Eclipse SDK?
Summary: org.eclipse.equinox.io is in the Eclipse SDK?
Status: VERIFIED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.7 RC2   Edit
Assignee: equinox.compendium-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-06 09:32 EDT by Thomas Watson CLA
Modified: 2011-05-16 10:49 EDT (History)
5 users (show)

See Also:
pascal: review+
tjwatson: review+


Attachments
patch for p2.inf (721 bytes, patch)
2011-05-12 15:17 EDT, DJ Houghton CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Watson CLA 2011-05-06 09:32:57 EDT
The latest API reports show org.eclipse.equinox.io was added to the Eclipse SDK, but I do not know why: http://download.eclipse.org/eclipse/downloads/drops/I20110505-0800/apitools/report.html

This bundle should not be included in the SDK.  I have a suspicion that it is because of the dynamic import added in bug 304706 to import javax.microedition.io (which is exported by org.eclipse.equinox.io).  But that makes no sense to me because I did not think p2 knew about dynamic imports or paid any attention to them.
Comment 1 DJ Houghton CLA 2011-05-06 09:45:03 EDT
It isn't included in any features, so it must be coming in as part of the director install.

It looks like the metadata for osgi.services has an optional package import on the package provided by this bundle:
        <required namespace='java.package' name='javax.microedition.io' range='0.0.0' optional='true'/>

Pascal, how do we handle dynamic imports in p2?
Comment 2 Thomas Watson CLA 2011-05-06 09:48:17 EDT
In bug192986 we had said that dynamic imports should not be considered, but it is unclear if we actually confirmed that this is the behavior of p2.  Simon mentioned that he disabled the case where wildcards (*) is used, but what about fully qualified dynamic imports?
Comment 3 Thomas Watson CLA 2011-05-12 13:37:03 EDT
I really think we need resolution on this bug.  We need to confirm that the p2 metadata is a result of the fully qualified dynamic import from org.eclipse.osgi.services.  If so I think that would be a mistake.  I think it is pretty clear that p2 should not pay attention to any dynamic imports, fully qualified or not.
Comment 4 DJ Houghton CLA 2011-05-12 13:51:31 EDT
I'm looking at the code in the BundlesAction class in the publisher and it appears to consider non-wildcard dynamic imports as regular optional imports.
Comment 5 DJ Houghton CLA 2011-05-12 15:17:18 EDT
Created attachment 195531 [details]
patch for p2.inf

Tom and Andrew and I discussed this. There are 2 approaches: change p2 metadata generation or change the osgi.services bundle. 

At this point in the release, we've decided to add a p2.inf file to the osgi.services bundle which makes the dynamic package import statements non-greedy when converted to p2 metadata. I've attached this as a patch.

We should investigate going forward if the right answer for dynamic package imports in general is to make them non-greedy. If we want to ignore them altogether, the code is in BundlesAction#createBundleIU:

...
if (importPackageName.indexOf('*') != -1 || "dynamic".equals(importSpec.getDirective(Constants.RESOLUTION_DIRECTIVE)))
...
Comment 6 Pascal Rapicault CLA 2011-05-12 18:00:01 EDT
I think marking them non-greedy by default is probably a good idea.
Comment 7 Thomas Watson CLA 2011-05-13 08:46:52 EDT
Moving back to compendium to make the p2.inf changes for o.e.osgi.services.  I opened bug 345726 to track the default greedy behavior of fully qualified dynamic imports in p2.
Comment 8 Thomas Watson CLA 2011-05-13 08:49:52 EDT
DJ, does the new p2.inf need to be included in the src.includes for the source build?
Comment 9 DJ Houghton CLA 2011-05-13 09:36:12 EDT
Nope, I don't think so.
Comment 10 Andrew Niefer CLA 2011-05-13 10:17:43 EDT
I would have said the '<' and '>' characters are not intended to be part of the p2.inf entries, instead it would just be 'requires.0.namespace = java.package'

However, I checked p2.inf parser, and that segment can really be anything, so '<0>' is valid.  org.eclipse.osgi.services exported using a feature to get metadata did result in greedy = false requirements.
Comment 11 Thomas Watson CLA 2011-05-13 10:39:48 EDT
Thanks Andrew, I released the patch and removed the '<' and '>' characters to make it more clear.  I kicked off a test build to confirm: 

https://hudson.eclipse.org/hudson/job/eclipse-equinox-test-N/355/
Comment 12 Thomas Watson CLA 2011-05-13 16:20:32 EDT
Test build was a success.
Comment 13 Thomas Watson CLA 2011-05-16 10:49:34 EDT
verified in I20110514-0800