Skip to content

Commit 5c2fd4e

Browse files
committed
refactor(FileListResolver): Remove RemoteProvenance cast
In order to avoid casting `KnownProvenance` to `RemoteProvenance`, a lot of parameters need to be changed to `RemoteProvenance`. Signed-off-by: Jens Keim <[email protected]>
1 parent d49ad8e commit 5c2fd4e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scanner/src/main/kotlin/ScanController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ internal class ScanController(
178178
/**
179179
* Return all provenances including sub-repositories associated with the identifiers of the packages they belong to.
180180
*/
181-
fun getIdsByProvenance(): Map<KnownProvenance, Set<Identifier>> =
181+
fun getIdsByProvenance(): Map<RemoteProvenance, Set<Identifier>> =
182182
buildMap<_, MutableSet<Identifier>> {
183183
getNestedProvenancesByPackage().forEach { (pkg, nestedProvenance) ->
184184
nestedProvenance.allProvenances.forEach { provenance ->

scanner/src/main/kotlin/utils/FileListResolver.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ class FileListResolver(
5656
* Get the [FileList] associated with the provided [provenance]. If it is not available in the [storage], download
5757
* the provenance and create the [FileList] from it.
5858
*/
59-
fun resolve(provenance: KnownProvenance): FileList {
59+
fun resolve(provenance: RemoteProvenance): FileList {
6060
storage.getFileList(provenance)?.let { return it }
6161

62-
val dir = provenanceDownloader.download(provenance as RemoteProvenance)
62+
val dir = provenanceDownloader.download(provenance)
6363

6464
return createFileList(dir).also {
6565
try {

0 commit comments

Comments
 (0)