Skip to content

Commit 1527bed

Browse files
committed
chore(model): Rename a version range function to not be limited to Ivy
Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 0f4854a commit 1527bed

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

model/src/main/kotlin/PackageCuration.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ package org.ossreviewtoolkit.model
2121

2222
import com.fasterxml.jackson.annotation.JsonProperty
2323

24-
import org.ossreviewtoolkit.model.utils.isApplicableIvyVersion
24+
import org.ossreviewtoolkit.model.utils.isApplicableVersionRangeFor
2525

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

6464
/**
6565
* Apply the curation [data] to the provided [basePackage] by calling [PackageCurationData.apply], if applicable.

model/src/main/kotlin/config/PackageConfiguration.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import org.ossreviewtoolkit.model.RepositoryProvenance
3030
import org.ossreviewtoolkit.model.SourceCodeOrigin
3131
import org.ossreviewtoolkit.model.VcsInfo
3232
import org.ossreviewtoolkit.model.VcsType
33-
import org.ossreviewtoolkit.model.utils.isApplicableIvyVersion
33+
import org.ossreviewtoolkit.model.utils.isApplicableVersionRangeFor
3434
import org.ossreviewtoolkit.model.utils.isVersionRange
3535
import org.ossreviewtoolkit.utils.common.replaceCredentialsInUri
3636

@@ -98,7 +98,7 @@ data class PackageConfiguration(
9898
if (!id.type.equals(otherId.type, ignoreCase = true) ||
9999
id.namespace != otherId.namespace ||
100100
id.name != otherId.name ||
101-
!id.isApplicableIvyVersion(otherId)
101+
!id.isApplicableVersionRangeFor(otherId)
102102
) {
103103
return false
104104
}

model/src/main/kotlin/utils/VersionUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import org.semver4j.Semver
3131
* Return true if the version of this [Identifier] interpreted as an Ivy, NPM or CocoaPods version range is applicable
3232
* to the package with the given [identifier][pkgId].
3333
*/
34-
internal fun Identifier.isApplicableIvyVersion(pkgId: Identifier) =
34+
internal fun Identifier.isApplicableVersionRangeFor(pkgId: Identifier) =
3535
runCatching {
3636
if (version == pkgId.version) return true
3737

0 commit comments

Comments
 (0)