[113022] Publish operation ordering
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
index 5453082..f44d4fa 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
@@ -97,17 +97,21 @@
 		"unknown", "starting", "started", "started_debug",
 		"stopping", "stopped", "started_unsupported", "started_profile"
 	};*/
-	
+
 	// publish listeners
 	protected transient List publishListeners;
-	
+
 	// Server listeners
 	protected transient ServerNotificationManager notificationManager;
 
 	public class AutoPublishThread extends Thread {
 		public boolean stop;
-		public int time = 0; 
-		
+		public int time = 0;
+
+		public AutoPublishThread() {
+			super("Automatic Publishing");
+		}
+
 		public void run() {
 			Trace.trace(Trace.FINEST, "Auto-publish thread starting for " + Server.this + " - " + time + "s");
 			if (stop)
@@ -129,6 +133,18 @@
 		}
 	}
 
+	private static final Comparator PUBLISH_OPERATION_COMPARTOR = new Comparator() {
+      public int compare(Object leftOp, Object rightOp) {
+          PublishOperation left = (PublishOperation) leftOp;
+          PublishOperation right = (PublishOperation) rightOp;
+          if (left.getOrder() > right.getOrder())
+              return 1;
+          if (left.getOrder() < right.getOrder())
+              return -1;
+          return 0;
+      }
+	};
+
 	// working copy, loaded resource
 	public Server(IFile file) {
 		super(file);
@@ -739,6 +755,8 @@
 			}
 		}
 		
+		Collections.sort(tasks, PUBLISH_OPERATION_COMPARTOR);
+		
 		return (PublishOperation[]) tasks.toArray(new PublishOperation[tasks.size()]);
 	}