diff --git a/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt b/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt index a892a687b38b1..f7462751c00e3 100644 --- a/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt +++ b/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt @@ -120,12 +120,12 @@ data class NestedProvenanceScanResult( return findings } - private fun Map>.mergeCopyrightFindings(): SortedSet { + private fun Map>.mergeCopyrightFindings(): Set { val findingsByPath = mapKeys { getPath(it.key) }.mapValues { (_, scanResults) -> scanResults.flatMap { it.summary.copyrightFindings } } - val findings = findingsByPath.flatMapTo(sortedSetOf()) { (path, findings) -> + val findings = findingsByPath.flatMapTo(mutableSetOf()) { (path, findings) -> val prefix = if (path.isEmpty()) path else "$path/" findings.map { it.copy(location = it.location.copy(path = "$prefix${it.location.path}")) } }