replaced <code></code> with more concise {@code}
[idea/community.git] / platform / external-system-api / src / com / intellij / openapi / externalSystem / model / Key.java
index 32f76849c68dfc6e4821d83c0c0efe04963ab917..91d91591591ae4ca227fea7516b79d6d74a3f33d 100644 (file)
@@ -41,7 +41,7 @@ public class Key<T> implements Serializable, Comparable<Key<?>> {
   private final int myProcessingWeight;
 
   /**
-   * Creates new <code>Key</code> object.
+   * Creates new {@code Key} object.
    * 
    * @param dataClass         class of the payload data which will be associated with the current key
    * @param processingWeight  there is a possible case that when a {@link DataNode} object has children of more than on type (children
@@ -57,7 +57,7 @@ public class Key<T> implements Serializable, Comparable<Key<?>> {
 
   @NotNull
   public static <T> Key<T> create(@NotNull Class<T> dataClass, int processingWeight) {
-    return new Key<T>(dataClass.getName(), processingWeight);
+    return new Key<>(dataClass.getName(), processingWeight);
   }
 
   public String getDataType() {
@@ -95,6 +95,7 @@ public class Key<T> implements Serializable, Comparable<Key<?>> {
 
   @Override
   public int compareTo(@NotNull Key<?> that) {
+    if(myProcessingWeight == that.myProcessingWeight) return myDataClass.compareTo(that.myDataClass);
     return myProcessingWeight - that.myProcessingWeight;
   }