-
Bug
-
Resolution: Fixed
-
Neutral
-
4.4.4
-
None
-
-
Yes
-
Empty show more show less
-
Yes
If a module has only optional dependencies, and none of those is present in the current system, the current dependency calculation blows up with the following exception
java.util.NoSuchElementException at java.util.AbstractList$Itr.next(AbstractList.java:350) at java.util.Collections.max(Collections.java:640) at info.magnolia.module.model.reader.DependencyLevelComparator.calcDependencyDepth(DependencyLevelComparator.java:110) at info.magnolia.module.model.reader.DependencyLevelComparator.compare(DependencyLevelComparator.java:76) at info.magnolia.module.model.reader.DependencyLevelComparator.compare(DependencyLevelComparator.java:52) at java.util.Arrays.mergeSort(Arrays.java:1270) at java.util.Arrays.mergeSort(Arrays.java:1281) at java.util.Arrays.mergeSort(Arrays.java:1281) at java.util.Arrays.mergeSort(Arrays.java:1282) at java.util.Arrays.sort(Arrays.java:1210) at java.util.Collections.sort(Collections.java:159) at info.magnolia.module.model.reader.DependencyCheckerImpl.sortByDependencyLevel(DependencyCheckerImpl.java:65) at info.magnolia.module.ModuleManagerImpl.loadDefinitions(ModuleManagerImpl.java:141)
Here's a patch and test that fixes the issue.
The attached test fails with 4.4.4.
Acceptance criteria