mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-22 21:55:39 +00:00
Merge branch 'master' into bug5147
This commit is contained in:
+14
-14
@@ -29,25 +29,25 @@ public class LogEventComparator implements Comparator<Timed>, Serializable {
|
||||
if (o1 instanceof AbstractLogEvent && o2 instanceof AbstractLogEvent) {
|
||||
return compareEvents((AbstractLogEvent<?>) o1, (AbstractLogEvent<?>) o2);
|
||||
}
|
||||
|
||||
// fallback to timed comparison
|
||||
return timedComparator.compare(o1, o2);
|
||||
}
|
||||
|
||||
protected int compareEvents(AbstractLogEvent<?> e1, AbstractLogEvent<?> e2) {
|
||||
//compare author priorities
|
||||
// compare author priorities
|
||||
int result = e1.getAuthor().compareTo(e2.getAuthor());
|
||||
if (result != 0) return result;
|
||||
|
||||
//compare created at timepoints
|
||||
result = e1.getCreatedAt().compareTo(e2.getCreatedAt());
|
||||
if (result != 0) return result;
|
||||
|
||||
//compare logical timepoints
|
||||
result = Util.compareToWithNull(e1.getLogicalTimePoint(), e2.getLogicalTimePoint(), /* nullIsLess */ false);
|
||||
if (result != 0) return result;
|
||||
|
||||
//compare ids
|
||||
return e1.getId().toString().compareTo(e2.getId().toString());
|
||||
if (result == 0) {
|
||||
// compare created at timepoints
|
||||
result = e1.getCreatedAt().compareTo(e2.getCreatedAt());
|
||||
if (result == 0) {
|
||||
// compare logical timepoints
|
||||
result = Util.compareToWithNull(e1.getLogicalTimePoint(), e2.getLogicalTimePoint(), /* nullIsLess */ false);
|
||||
if (result == 0) {
|
||||
// compare ids
|
||||
result = e1.getId().toString().compareTo(e2.getId().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package com.sap.sailing.domain.coursetemplate;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import com.sap.sailing.domain.base.ControlPointWithTwoMarks;
|
||||
import com.sap.sailing.domain.coursetemplate.impl.MarkRolePairImpl;
|
||||
@@ -24,7 +24,7 @@ public interface MarkRolePair extends ControlPointTemplate {
|
||||
* the cache, it is returned. Otherwise, a new pair is created, entered into the cache and then returned.
|
||||
*/
|
||||
public class MarkRolePairFactory {
|
||||
private final Map<MarkRolePair, MarkRolePair> markPairs = new HashMap<>();
|
||||
private final ConcurrentMap<MarkRolePair, MarkRolePair> markPairs = new ConcurrentHashMap<>();
|
||||
|
||||
public MarkRolePair create(String name, String shortName, MarkRole left, MarkRole right) {
|
||||
// use name as short name if none is provided
|
||||
|
||||
Reference in New Issue
Block a user