Skip to content

Comparison method violates its general contract! #645

@GianfrancoMS

Description

@GianfrancoMS

🐛 Describe the bug

When i run, ./gradlew refreshVersions, it throws this exception:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':refreshVersions'.
> Comparison method violates its general contract!

Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
        at kotlin.collections.ArraysKt___ArraysJvmKt.sort(_ArraysJvm.kt:2400)
        at kotlin.collections.CollectionsKt___CollectionsKt.sorted(_Collections.kt:1030)
        at de.fayard.refreshVersions.core.internal.GettingVersionCandidatesKt.sortWith(GettingVersionCandidates.kt:30)
        at de.fayard.refreshVersions.core.internal.GettingVersionCandidatesKt.getVersionCandidates(GettingVersionCandidates.kt:16)
        at de.fayard.refreshVersions.core.internal.GettingVersionCandidatesKt$getVersionCandidates$1.invokeSuspend(GettingVersionCandidates.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:279)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at de.fayard.refreshVersions.core.RefreshVersionsTask.taskActionRefreshVersions(RefreshVersionsTask.kt:74)

I manage my dependencies using a TOML file at gradle/libs.versions.toml
I'm using version 0.51.0

⚠️ Current behavior

It does not work in my project.

✅ Expected behavior

It should work without exceptions.

💣 Steps to reproduce

📱 Tech info

Unfortunately, I can't provide a build scan due to privacy reasons from my company.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions