[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] OSGI / PDE /equinox dependency leak for imported packages with classes with base classes in other bundles

Thanks for the clear and useful answer!

cheers
erwin

On Sat, Sep 19, 2009 at 4:59 PM, Jeff McAffer <jeff@xxxxxxxxxxxxxxxxx> wrote:
This is required for the compiler.  At compile time you need to see the complete supertype hierarchy of the type being compiled.  At runtime this is not required.  Basically this is caused by the JDT compiler using a flattened classpath rather than a delegating structure that matches the OSGi runtime.

To get around this, add the the bundle declaring the super type (b.A in this case) to the Automated Management of Dependencies section on the Dependencies page of b.C's manifest editor. this puts it on the compile time classpath of b.C but does not add it to b.C's manifest.

Voila

Jeff



On 17-Sep-09, at 5:00 AM, erwin dl wrote:

Dear,

I have the following situation which should occur in many OSGi applications :

- bundle b.A implements/delivers some library containing a base class with full name b.A.BaseClass
-- this BaseClass implements some public methods
- bundle b.B implements/delivers a concrete implementation with a class b.B.SubClass that inherits from b.A.BaseClass
- bundle b.C needs to use b.B.SubClass

In such a case, I would assume that bundle b.C only needs to express a dependency (import package) on bundle b.B, and the fact that b.B.SubClass inherits from a BaseClass should be an implementation detail, transparent for b.C.

But, unfortunately, once I want to use a method on b.B.SubClass, which is inherited from the BaseClass, PDE forces me to also include a dependency on b.A in b.C.

And so there is a dependency leakage...

Is this caused by a fundamental OSGi construct/decision/..., or specific for PDE?

kind regards
erwin
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev