From 36e305b48d45dc4c29ea3e99ea450490efc4c8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sat, 11 May 2024 07:38:06 +0200 Subject: [PATCH] Use RepositoryEvent.newDiscoveryEvent(..) and pass the nickname Currently even if a reference would define a nickname it is not passed by the repository event resulting in an updatesite to have an empty name. This uses the RepositoryEvent.newDiscoveryEvent(...) method to pass the nickname is present. --- .../p2/metadata/repository/LocalMetadataRepository.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java index 8dddf8a2b..aff033c6e 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java @@ -186,13 +186,14 @@ public void initialize(RepositoryState state) { */ public void publishRepositoryReferences() { IProvisioningEventBus bus = getProvisioningAgent().getService(IProvisioningEventBus.class); - if (bus == null) + if (bus == null) { return; - + } List repositoriesSnapshot = createRepositoriesSnapshot(); for (IRepositoryReference reference : repositoriesSnapshot) { - bus.publishEvent(new RepositoryEvent(reference.getLocation(), reference.getType(), - RepositoryEvent.DISCOVERED, reference.isEnabled())); + RepositoryEvent event = RepositoryEvent.newDiscoveryEvent(reference.getLocation(), reference.getNickname(), + reference.getType(), reference.isEnabled()); + bus.publishEvent(event); } }