This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit dc4e84ef94c8edc23fdb4e0015c10049bd1cc968
Author: Alex Heneveld <[email protected]>
AuthorDate: Mon Dec 6 12:35:27 2021 +0000

    fix bug where upgraded bundles are still used in search path
---
 .../apache/brooklyn/core/mgmt/rebind/RebindIteration.java    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java 
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
index e85918d..df0a105 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
@@ -1068,26 +1068,26 @@ public abstract class RebindIteration {
             if (searchPath != null && !searchPath.isEmpty()) {
                 for (String searchItemId : searchPath) {
                     String fixedSearchItemId = null;
+                    VersionedName searchItemVersionedName = 
VersionedName.fromString(searchItemId);
+
                     OsgiManager osgi = 
managementContext.getOsgiManager().orNull();
 
-                    VersionedName bundleVN = 
VersionedName.fromString(searchItemId);
                     String bundleUpgraded = 
CatalogUpgrades.getBundleUpgradedIfNecessary(managementContext, searchItemId);
                     if (bundleUpgraded!=null && 
!bundleUpgraded.equals(searchItemId)) {
                         logRebindingDebug("Upgrading search path entry of " + 
bType.getSimpleName().toLowerCase() + " " + contextSuchAsId + " from " + 
searchItemId + " to bundle " + bundleUpgraded);
-                        bundleVN = VersionedName.fromString(bundleUpgraded);
+                        searchItemVersionedName = 
VersionedName.fromString(bundleUpgraded);
                     }
 
                     if (osgi != null) {
-                        ManagedBundle bundle = osgi.getManagedBundle(bundleVN);
+                        ManagedBundle bundle = 
osgi.getManagedBundle(searchItemVersionedName);
                         if (bundle != null) {
                             // found as bundle
-                            reboundSearchPath.add(searchItemId);
+                            fixedSearchItemId = 
searchItemVersionedName.toOsgiString();
+                            reboundSearchPath.add(fixedSearchItemId);
                             continue;
                         }
                     }
 
-
-
                     // look for as a type now
                     RegisteredType t1 = 
managementContext.getTypeRegistry().get(searchItemId);
                     if (t1 == null) {

Reply via email to