Skip to content

Commit e86d16d

Browse files
committed
refactor(model): Rename isVersionRange() to hasIvyVersionRange()
Strictly, an `Identifier` cannot *be* an Ivy version, but only *have* one, so reflect this in the naming. While this renames a public function, it was decided to not mark this as a breaking change, because it is an ORT utility function that so far has only been used internally. Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
1 parent d35938b commit e86d16d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import org.ossreviewtoolkit.model.SourceCodeOrigin
3131
import org.ossreviewtoolkit.model.VcsInfo
3232
import org.ossreviewtoolkit.model.VcsType
3333
import org.ossreviewtoolkit.model.utils.isApplicableIvyVersion
34-
import org.ossreviewtoolkit.model.utils.isVersionRange
34+
import org.ossreviewtoolkit.model.utils.hasIvyVersionRange
3535
import org.ossreviewtoolkit.utils.common.replaceCredentialsInUri
3636

3737
/**
@@ -86,7 +86,7 @@ data class PackageConfiguration(
8686
"A package configuration must contain at most one of 'sourceArtifactUrl', 'vcs' or 'sourceCodeOrigin'."
8787
}
8888

89-
if (id.isVersionRange()) {
89+
if (id.hasIvyVersionRange()) {
9090
require(vcs == null && sourceArtifactUrl == null) {
9191
"A package configuration cannot have a version range and a 'vcs' or 'sourceArtifactUrl'."
9292
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import org.semver4j.range.RangeListFactory
3333
/**
3434
* Return true if the version of this [Identifier] is an Ivy version range.
3535
*/
36-
fun Identifier.isVersionRange(): Boolean = version.getIvyVersionRanges().get().isNotEmpty()
36+
fun Identifier.hasIvyVersionRange(): Boolean = version.getIvyVersionRanges().get().isNotEmpty()
3737

3838
/**
3939
* Return true if the version of this [Identifier] interpreted as an Ivy version matcher is applicable to the

0 commit comments

Comments
 (0)