From dev-return-104670-archive-asf-public=cust-asf.ponee.io@sling.apache.org Tue Mar 17 14:39:03 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 1D1D8180675 for ; Tue, 17 Mar 2020 15:39:03 +0100 (CET) Received: (qmail 70577 invoked by uid 500); 17 Mar 2020 14:39:02 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 70512 invoked by uid 99); 17 Mar 2020 14:39:02 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Mar 2020 14:39:02 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 951F9E3146 for ; Tue, 17 Mar 2020 14:39:01 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 584557805F5 for ; Tue, 17 Mar 2020 14:39:00 +0000 (UTC) Date: Tue, 17 Mar 2020 14:39:00 +0000 (UTC) From: "Konrad Windszus (Jira)" To: dev@sling.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (SLING-9210) Make DynamicClassloader behave deterministically in case several bundles export the same package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SLING-9210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17060936#comment-17060936 ] Konrad Windszus edited comment on SLING-9210 at 3/17/20, 2:38 PM: ------------------------------------------------------------------ As https://osgi.org/javadoc/r6/core/org/osgi/service/packageadmin/PackageAdmin.html#getExportedPackages(org.osgi.framework.Bundle) is deprecated anyways, one should maybe leverage the new wiring spec (https://osgi.org/specification/osgi.core/7.0.0/framework.wiring.html) instead. Still one would need to sort the results to make it behave more predictable. [~cziegeler] WDYT? Does OSGi specify a particular order in case multiple bundles would satisfy all requirements? I couldn't find anything in https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#framework.module.resolvingprocess. was (Author: kwin): As https://osgi.org/javadoc/r6/core/org/osgi/service/packageadmin/PackageAdmin.html#getExportedPackages(org.osgi.framework.Bundle) is deprecated anyways, one should maybe leverage the new wiring spec (https://osgi.org/specification/osgi.core/7.0.0/framework.wiring.html) instead. Still one would need to sort the results to make it behave more predictable. [~cziegeler] WDYT? > Make DynamicClassloader behave deterministically in case several bundles export the same package > ------------------------------------------------------------------------------------------------ > > Key: SLING-9210 > URL: https://issues.apache.org/jira/browse/SLING-9210 > Project: Sling > Issue Type: Improvement > Affects Versions: Commons ClassLoader 1.4.4 > Reporter: Konrad Windszus > Priority: Major > Fix For: Commons ClassLoader 1.4.6 > > > 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. -- This message was sent by Atlassian Jira (v8.3.4#803005)