diff options
2 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties index 33689fcb8..ada52de67 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties @@ -40,7 +40,7 @@ mirror_alreadyExists=Artifact: {0} already exists in repository: {1}. message_artifactsFromChildRepos=Messages while reading artifacts from child repositories message_problemReadingArtifact=Problems while reading artifacts from {0} -exception_comparatorNotFound = The Artifact Comparator {0} was not found. +exception_comparatorNotFound = The Artifact Comparator {0} was not found. Available artifact comparators: {1}. exception_noComparators = No Artifact Comparators are available. MirrorLog_Console_Log=Logging to the console instead. MirrorLog_Exception_Occurred=An exception occurred while writing to the log: diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/comparator/ArtifactComparatorFactory.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/comparator/ArtifactComparatorFactory.java index 49bdf7302..b8a6dcbff 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/comparator/ArtifactComparatorFactory.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/comparator/ArtifactComparatorFactory.java @@ -13,6 +13,7 @@ package org.eclipse.equinox.p2.repository.tools.comparator; import java.util.*; +import java.util.stream.Collectors; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.RegistryFactory; import org.eclipse.equinox.internal.p2.artifact.repository.Messages; @@ -40,8 +41,10 @@ public class ArtifactComparatorFactory { if (artifactComparator.isPresent()) return artifactComparator.get(); - if (comparatorID != null) - throw new IllegalArgumentException(NLS.bind(Messages.exception_comparatorNotFound, comparatorID)); + if (comparatorID != null) { + String comparators = extensions.stream().map(extension -> extension.getAttribute(ATTR_ID)).collect(Collectors.joining(", ")); //$NON-NLS-1$ + throw new IllegalArgumentException(NLS.bind(Messages.exception_comparatorNotFound, comparatorID, comparators)); + } throw new IllegalArgumentException(Messages.exception_noComparators); } |