Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] package resolver bugs? PDE bugs?

Consider a workspace with four bundles:

  org.osxa.pdetestExport1
    -- export org.osxa.pdetest // no version=, implying version=0.0.0
       -- contains IAmAnInterface

  org.osxa.pdetestExport1
    -- export org.osxa.pdetest;version="2.7"
       -- contains IAmAnInterface, AmAnImplementation

  org.osxa.pdetestImport1
    -- import org.osxa.pdetest
                       // no version=, implying version=[0.0.0, oo)
       -- activator uses IAmAnInterface, AmAnImplementation

  org.osxa.pdetestImport2
    -- import org.osxa.pdetest;version="0.0.0"
                       // equivalent to version=[0.0.0, oo)
       -- activator uses IAmAnInterface, AmAnImplementation


---

Both Import1 and Import2 use an interface and it's implementation,
the interface exists in both Export1 and Export2, the implementation
is available only in Export2.

Since both Import1 and Import2 import the same package, I'd expect
them both to find the interface and to maybe find the implementation class.

But in the PDE, Import1 finds neither while Import2 finds both.

Finding both is legal (in the OSGi framework "An exporter with a higher
version is preferred over an exporter with a lower version"), but in the
PDE I'd expect the import to be wired to the *lowest* matching export
(because that helps check whether the version constraint is truthful).

Finding none for Import1 should definitely  be a bug, because not
specifying the version constraint should be equivalent to asking for
version=0.0.0 which is a shortcut for version="[0.0.0, oo)" (which
couldn't be specified, anyway, because the "infinity" symbol is not
legal in a Manifest header),

The problem is made more serious by the fact that the PDE resolver seems
to consider disabled plugins that exist in the Target Platform to be
viable exporters (and that means I have only one bundle in my workspace
that exports a package but it can't be found because a *disabled* bundle
also exports the same package but without a version constraint, it
happened to me with the javax.servlet package).

Another problem is that when these bundles are run in Equinox, the
equinox resolver seems to wire both Export1 and Export2 to the classes
exported by Export2, which is illegal in OSGi R4 (the bundles specify
the "Bundle-ManifestVersion: 2" header), because an Export-Package: no
longer implies an Import-Package: for the same packages.

I couldn't find any entries for these in bugzilla.

Are they bugs?



Harald

PS: The workspace demonstrating the problem is available at
http://osxa.org/downloads/hn3000/workspace-pde-bug.zip



Back to the top