Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-907

Regression in latest BND code: negated exports are applied to private packages

    XMLWordPrintableJSON

Details

    Description

      The latest version of the Bnd Tool has a bug where it combines the Export-Package instructions with the Private-Package instructions:

      all.putAll(replaceWitInstruction(getHeader(EXPORT_PACKAGE),
      EXPORT_PACKAGE));

      all.putAll(replaceWitInstruction(getHeader(PRIVATE_PACKAGE),
      PRIVATE_PACKAGE));

      this ordering means that any negated packages in Export-Package are erroneously applied to the list of packages in Private-Package.

      For example, when you have instructions like the following:

      <Export-Package>!org.foo.internal.,org.foo.</Export-Package>
      <Private-Package>org.foo.internal.*</Private-Package>

      the Bnd Tool will end up excluding the internal packages from the final bundle.

      Reversing the statements to be:

      all.putAll(replaceWitInstruction(getHeader(PRIVATE_PACKAGE),
      PRIVATE_PACKAGE));

      all.putAll(replaceWitInstruction(getHeader(EXPORT_PACKAGE),
      EXPORT_PACKAGE));

      appears to fix the problem, although you could then have problems with negated packages in the Private-Package affecting the Export-Package - but this is less likely.

      Attachments

        1. FELIX-907-20090129.patch
          0.8 kB
          Stuart McCulloch

        Activity

          People

            pkriens Peter Kriens
            mcculls Stuart McCulloch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: