Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9210

Make DynamicClassloader behave deterministically in case several bundles export the same package

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Commons ClassLoader 1.4.4
    • Commons ClassLoader 1.4.6
    • None
    • None

    Description

      Currently in case several bundles export the same package (in different versions) the first one is being picked in https://github.com/apache/sling-org-apache-sling-commons-classloader/blob/dedb69a9fb0f8cb2ebf3050560311739b9f00ce4/src/main/java/org/apache/sling/commons/classloader/impl/PackageAdminClassLoader.java#L156, but it is not described which one is the first one in https://osgi.org/javadoc/r6/core/org/osgi/service/packageadmin/PackageAdmin.html#getExportedPackages(org.osgi.framework.Bundle).

      Given that now it is possible to install the same bundle in multiple version (SLING-9172 and FELIX-6232) a better, more predictable logic should be chosen.

      I propose to always pick the highest exported version which is in line with the logic from https://osgi.org/javadoc/r6/core/org/osgi/service/packageadmin/PackageAdmin.html#getExportedPackage(java.lang.String).

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            kwin Konrad Windszus

            Dates

              Created:
              Updated:

              Issue deployment