[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] OSGI / PDE /equinox dependency leak for imported packages with classes with base classes in other bundles
- From: Jeff McAffer <jeff@xxxxxxxxxxxxxxxxx>
- Date: Sat, 19 Sep 2009 10:59:12 -0400
- Delivered-to: firstname.lastname@example.org
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.
On 17-Sep-09, at 5:00 AM, erwin dl wrote:
I have the following situation which should occur in many OSGi
- 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?
equinox-dev mailing list