From d398d25d6d2342652b9637850334abef48fa39f5 Mon Sep 17 00:00:00 2001 From: Sam Davis Date: Mon, 24 Sep 2012 15:47:13 -0700 Subject: 389946: ExtensionPointReader ignores priorityAttributeId value Change-Id: I4c657e6131ca26bc9ad07e426ab40a9095ed2b23 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389946 --- .../org/eclipse/mylyn/commons/core/ExtensionPointReader.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/ExtensionPointReader.java') diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/ExtensionPointReader.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/ExtensionPointReader.java index 467589de..06e6c2bc 100644 --- a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/ExtensionPointReader.java +++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/ExtensionPointReader.java @@ -32,21 +32,19 @@ import org.eclipse.osgi.util.NLS; * @since 3.7 */ public class ExtensionPointReader { - - private static final class PriorityComparator implements Comparator { - + private final class PriorityComparator implements Comparator { public int compare(IConfigurationElement arg0, IConfigurationElement arg1) { double p0 = 0; double p1 = 0; try { - String priorityAttribute = arg0.getAttribute(DEFAULT_ATTRIBUTE_ID_PRIORITY); + String priorityAttribute = arg0.getAttribute(getPriorityAttributeId()); if (priorityAttribute != null) { p0 = Double.parseDouble(priorityAttribute); } } catch (NumberFormatException e) { } try { - String priorityAttribute = arg1.getAttribute(DEFAULT_ATTRIBUTE_ID_PRIORITY); + String priorityAttribute = arg1.getAttribute(getPriorityAttributeId()); if (priorityAttribute != null) { p1 = Double.parseDouble(priorityAttribute); } @@ -66,7 +64,7 @@ public class ExtensionPointReader { private static final String DEFAULT_ATTRIBUTE_ID_PRIORITY = "priority"; //$NON-NLS-1$ - private static final PriorityComparator PRIORITY_COMPARATOR = new PriorityComparator(); + private final PriorityComparator priorityComparator = new PriorityComparator(); private String classAttributeId; @@ -147,7 +145,7 @@ public class ExtensionPointReader { IExtension[] extensions = extensionPoint.getExtensions(); for (IExtension extension : extensions) { IConfigurationElement[] elements = extension.getConfigurationElements(); - Arrays.sort(elements, PRIORITY_COMPARATOR); + Arrays.sort(elements, priorityComparator); for (IConfigurationElement element : elements) { if (element.getName().equals(elementId) && shouldRead(element)) { T item = readElement(element, result); -- cgit v1.2.3