summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2013-07-03 10:49:37 (EDT)
committer Curtis Windatt2013-07-03 10:50:04 (EDT)
commit90ea90ab579a6b2be7a35187cbf2ead52d0e0481 (patch)
treefba7717b911438405d856fb52be0ce983d116a36
parent36964f397a14a4c461c9d6ef84665352352c905c (diff)
downloadeclipse.pde.ui-90ea90ab579a6b2be7a35187cbf2ead52d0e0481.zip
eclipse.pde.ui-90ea90ab579a6b2be7a35187cbf2ead52d0e0481.tar.gz
eclipse.pde.ui-90ea90ab579a6b2be7a35187cbf2ead52d0e0481.tar.bz2
Bug 411965 - PDE target definition serialization - keep included bundle
-rw-r--r--ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinitionPersistenceHelper.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinitionPersistenceHelper.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinitionPersistenceHelper.java
index 9f1a3dd..9b2cac3 100644
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinitionPersistenceHelper.java
+++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinitionPersistenceHelper.java
@@ -12,6 +12,8 @@ package org.eclipse.pde.internal.core.target;
import java.io.*;
import java.text.MessageFormat;
+import java.util.Arrays;
+import java.util.Comparator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.parsers.*;
@@ -124,6 +126,15 @@ public class TargetDefinitionPersistenceHelper {
NameVersionDescriptor[] included = definition.getIncluded();
if (included != null) {
+ Arrays.sort(included, new Comparator<NameVersionDescriptor>() {
+ public int compare(NameVersionDescriptor o1, NameVersionDescriptor o2) {
+ int compareType = o1.getType().compareTo(o2.getType());
+ if (compareType != 0) {
+ return compareType;
+ }
+ return o1.getId().compareTo(o2.getId());
+ }
+ });
Element includedElement = doc.createElement(INCLUDE_BUNDLES);
serializeBundles(doc, includedElement, included);
rootElement.appendChild(includedElement);