Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions model/src/main/kotlin/PackageCuration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package org.ossreviewtoolkit.model

import com.fasterxml.jackson.annotation.JsonProperty

import org.ossreviewtoolkit.model.utils.isApplicableIvyVersion
import org.ossreviewtoolkit.model.utils.isApplicableVersionRangeFor

/**
* Return true if this string equals the [other] string, or if either string is blank.
Expand Down Expand Up @@ -59,7 +59,7 @@ data class PackageCuration(
*/
fun isApplicable(pkgId: Identifier): Boolean =
isApplicableDisregardingVersion(pkgId)
&& (id.version.equalsOrIsBlank(pkgId.version) || id.isApplicableIvyVersion(pkgId))
&& (id.version.equalsOrIsBlank(pkgId.version) || id.isApplicableVersionRangeFor(pkgId))

/**
* Apply the curation [data] to the provided [basePackage] by calling [PackageCurationData.apply], if applicable.
Expand Down
4 changes: 2 additions & 2 deletions model/src/main/kotlin/config/PackageConfiguration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.ossreviewtoolkit.model.RepositoryProvenance
import org.ossreviewtoolkit.model.SourceCodeOrigin
import org.ossreviewtoolkit.model.VcsInfo
import org.ossreviewtoolkit.model.VcsType
import org.ossreviewtoolkit.model.utils.isApplicableIvyVersion
import org.ossreviewtoolkit.model.utils.isApplicableVersionRangeFor
import org.ossreviewtoolkit.model.utils.isVersionRange
import org.ossreviewtoolkit.utils.common.replaceCredentialsInUri

Expand Down Expand Up @@ -98,7 +98,7 @@ data class PackageConfiguration(
if (!id.type.equals(otherId.type, ignoreCase = true) ||
id.namespace != otherId.namespace ||
id.name != otherId.name ||
!id.isApplicableIvyVersion(otherId)
!id.isApplicableVersionRangeFor(otherId)
) {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion model/src/main/kotlin/utils/VersionUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.semver4j.Semver
* Return true if the version of this [Identifier] interpreted as an Ivy, NPM or CocoaPods version range is applicable
* to the package with the given [identifier][pkgId].
*/
internal fun Identifier.isApplicableIvyVersion(pkgId: Identifier) =
internal fun Identifier.isApplicableVersionRangeFor(pkgId: Identifier) =
runCatching {
if (version == pkgId.version) return true

Expand Down
Loading