We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f80a5c commit 03655f6Copy full SHA for 03655f6
1 file changed
src/main/java/org/spdx/storage/listedlicense/LicenseJson.java
@@ -19,6 +19,7 @@
19
20
import java.util.ArrayList;
21
import java.util.Collections;
22
+import java.util.Comparator;
23
import java.util.HashMap;
24
import java.util.HashSet;
25
import java.util.List;
@@ -557,4 +558,14 @@ public List<PropertyDescriptor> getPropertyValueDescriptors() {
557
558
});
559
return retval;
560
}
561
+
562
+ /**
563
+ * Sort the crossRef list by order, with URL as a secondary sort key for
564
+ * entries with no order set.
565
+ */
566
+ public void sortCrossRef() {
567
+ crossRef.sort(Comparator
568
+ .comparingInt((CrossRefJson c) -> c.order != null ? c.order : Integer.MAX_VALUE)
569
+ .thenComparing(c -> c.url != null ? c.url : ""));
570
+ }
571
0 commit comments