MetaData comparison fix (take LUID into account)
authorNiki Roo <niki@nikiroo.be>
Mon, 26 Mar 2018 20:32:53 +0000 (22:32 +0200)
committerNiki Roo <niki@nikiroo.be>
Mon, 26 Mar 2018 20:32:53 +0000 (22:32 +0200)
src/be/nikiroo/fanfix/data/MetaData.java

index 53525fdc58726eee7bd274dc10b5e4adf7568516..b2217ae3f4b721d235d7ee830c611514b68c9b90 100644 (file)
@@ -384,18 +384,12 @@ public class MetaData implements Cloneable, Comparable<MetaData> {
                        return 1;
                }
 
-               String uuid = getUuid();
-               String oUuid = o.getUuid();
-
-               if (uuid == null) {
-                       uuid = "";
-               }
-
-               if (oUuid == null) {
-                       oUuid = "";
-               }
+               String id = (getUuid() == null ? "" : getUuid())
+                               + (getLuid() == null ? "" : getLuid());
+               String oId = (getUuid() == null ? "" : o.getUuid())
+                               + (o.getLuid() == null ? "" : o.getLuid());
 
-               return uuid.compareTo(oUuid);
+               return id.compareTo(oId);
        }
 
        @Override