Skip to content

Commit

Permalink
refactor(model)!: Remove PackageConfigurationProvider from OrtResult
Browse files Browse the repository at this point in the history
Change `OrtResult` to not implement the `PackageConfigurationProvider`
interface. This is required to be able to move the interface to the API
module for package configuration providers.

`OrtResult` was never used as a `PackageConfigurationProvider` directly,
but the `getPackageConfigurations` function is used in several places,
so keep it.

The interface was added in 07d06bb for documentation purposes.

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.com>
  • Loading branch information
mnonnenmacher committed Sep 3, 2024
1 parent e0e8465 commit e785545
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions model/src/main/kotlin/OrtResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import org.ossreviewtoolkit.model.config.Resolutions
import org.ossreviewtoolkit.model.config.RuleViolationResolution
import org.ossreviewtoolkit.model.config.VulnerabilityResolution
import org.ossreviewtoolkit.model.config.orEmpty
import org.ossreviewtoolkit.model.utils.PackageConfigurationProvider
import org.ossreviewtoolkit.model.utils.ResolutionProvider
import org.ossreviewtoolkit.model.vulnerabilities.Vulnerability
import org.ossreviewtoolkit.utils.common.zipWithCollections
Expand Down Expand Up @@ -89,7 +88,7 @@ data class OrtResult(
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
val labels: Map<String, String> = emptyMap()
) : ResolutionProvider, PackageConfigurationProvider {
) : ResolutionProvider {
companion object {
/**
* A constant for an [OrtResult] with an empty repository and all other properties `null`.
Expand Down Expand Up @@ -363,7 +362,7 @@ data class OrtResult(
/**
* Return a list of [PackageConfiguration]s for the given [packageId] and [provenance].
*/
override fun getPackageConfigurations(packageId: Identifier, provenance: Provenance): List<PackageConfiguration> =
fun getPackageConfigurations(packageId: Identifier, provenance: Provenance): List<PackageConfiguration> =
packageConfigurationsById[packageId].orEmpty().filter { it.matches(packageId, provenance) }

/**
Expand Down

0 comments on commit e785545

Please sign in to comment.