felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arjun Panday (JIRA)" <j...@apache.org>
Subject [jira] Created: (FELIX-1809) OBR issue when using parameters with exported packages
Date Mon, 26 Oct 2009 16:52:59 GMT
OBR issue when using parameters with exported packages

                 Key: FELIX-1809
                 URL: https://issues.apache.org/jira/browse/FELIX-1809
             Project: Felix
          Issue Type: Bug
          Components: Bundle Repository (OBR)
            Reporter: Arjun Panday

Please consider the attached test case along with the proposed patch.

- I have single bundle (A.jar) containing com.a.class and exporting the package com.a with
a version and a "tag"
ie: Export-Package: com.a; version="1.2.3";tag="mytag"

- I use bnd to build the bundle and it generates a similar import (which is good)
ie: Import-Package: com.a; version="1.2.3";tag="mytag"

- I use bindex to generate the repository (containing only this bundle) which, in turn, generates
the following requirement:
<require extend='false' filter='(&amp;(package=com.a)(version&gt;=1.2.3)(tag=mytag)(mandatory:&lt;*tag))'
multiple='false' name='package' optional='false'>
      Import package com.a ;version=1.2.3

As such when I try to resolve bundle A from the OBR, it fails. 
Bundle A does not have a "mandatory" attribute in its capabilities, but as the spec suggests
(p18 of RFC-0112):

"If the value does not exist, then it is still possible to match a subset. A non-existent
property is a proper subset of
any set. A non-existent property is a superset if the list is empty.
    (mandatory:<*vendor,var)                                         Mandatory must contain
vendor, var, both or be empty."

While investigating this issue, i found 2 NullPointerExceptions, in the code of bundlerepository
(the first one being hidden behind an empty try/catch)

When I fix these NullPointerExceptions, the OBR successfully resolves bundle A and my test
BUT.. FilterImplTest now fails!

IF my understanding is right, i think line 73 of FilterImplTest should read assertTrue instead
of assertFalse.. (but I must admit that i find the meaning of this "mandatory" part quite

I'm attaching the test and the proposed patch in 2 separate tar files (to be extracted under


This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message