Hi Stuart, Thanks for the answer. Let's see what Peter thinks ... Maybe it is, as Niclas points out, that the uses lists should be scanned for private packages...
I also see that it does not hurt, but it leaks information, which in my understanding of OSGi is somewhat counter the OSGi idea. Regards Felix Am Mittwoch, den 02.01.2008, 11:36 +0800 schrieb Stuart McCulloch: > On 02/01/2008, Felix Meschberger <[EMAIL PROTECTED]> wrote: > > > > Hi all, > > > > I have an incertainty regarding the "uses" directive in Export-Package > > manifest headers: The current 1.1.0 SNAPSHOT of the Bundle Plugin (also > > the 1.0.0 release) creates a "uses" entry for each referenced package of > > a class. > > > > Consider now two packages org.sample and org.sample.impl. The org.sample > > package is exported, the org.sample.impl package is private and not > > exported. If a class in the org.sample calls into a class of the > > org.sample.impl package, the bundle plugin generates an export statement > > for the org.sample package: > > > > Export-Package: org.sample;uses:="org.sample.impl" > > > > Is this correct ? > > > > If I understand it correctly, listing a package in the "uses" directive > > is not required, as long as the package does not occurr in any method > > signature or field type. In fact, I think the use of the org.sample.impl > > package is an implementation detail, which should not be "leaked" into > > the Export-Package statement. > > > > Any hints or help ? Thanks. > > > Hi Felix, > > As I understand it, the BND tool adds all non-exported packages that are > referred to by the exported package to its "uses" list - and this may result > in more packages in "uses" than is strictly necessary, as it will also > include > classes that will never leak outside of the package. > > The extra packages shouldn't cause any problems (they're just additional > constraints in case internal objects happen to leak outside the public API) > > If you'd like to set your own "uses" clause, or feel strongly about internal > classes appearing in the "uses" list then I'd suggest you discuss this with > PeterK, as it would require a change to the BND tool itself. > > HTH > > Regards and a happy new year > > Felix > > > > > >
