[Error]Comparison method violates its general contract

Hi Jmix Team,

I encountered the following issue when running my project:

Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
    at io.jmix.flowui.sys.AbstractBasePackageConfigurationSorter.sort(...)
    at io.jmix.flowui.impl.ActionsImpl.postConstruct(ActionsImpl.java:95)

As a temporary workaround, I applied the following JVM option (based on a suggestion from Claude), which resolves the issue:

-Djava.util.Arrays.useLegacyMergeSort=true

However, I understand this is not a permanent fix.

Could you advise on the possible root causes of this issue? Specifically:

  • Could this be related to inconsistent or non-transitive comparator logic in AbstractBasePackageConfigurationSorter ?
  • Are there known issues with certain Java versions or FlowUI configurations that might trigger this behavior?
  • Is there a recommended fix or configuration change to address this properly?

Appreciate your guidance on this.

Thank you.