[246624] resourceFactories extension override enhancement
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/impl/WTPResourceFactoryRegistry.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/impl/WTPResourceFactoryRegistry.java
index 96f8777..b341d20 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/impl/WTPResourceFactoryRegistry.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/impl/WTPResourceFactoryRegistry.java
@@ -289,7 +289,7 @@
 		
 		/**
 		 * Sort in the following manner:
-		 * First, sort by shortName
+		 * First, sort by shortName, if shortName is null, then it comes last
 		 * If shortNames are equal, then sort by isDefault
 		 * If isDefault is also equal, then the one defining a factoryClassName wins
 		 * If both have factoryClassNames, then check to see if one overrides the other via overridesFactoryClassName
@@ -301,6 +301,14 @@
 			if(this == other){
 				return 0;
 			}
+			if(shortName == null && other.shortName == null){
+				return 0;
+			} else if(shortName == null){
+				return 1;
+			} else if(other.shortName == null){
+				return -1;
+			}
+			
 			int shortNameCompare = this.shortName.compareTo(other.shortName);
 			if(shortNameCompare != 0){
 				return shortNameCompare;