VU
Size: a a a
VU
VU
PE
N
PE
N
N
Ⓢ
И
И
N
Ⓢ
Ⓢ
VS
interface PomLoader {
suspend fun load(id: ComponentIdentifier): PomContents
}
огда
в самом загрузчике непонятно в какой момент заканчивается «текущая группа».VV
interface PomLoader {
suspend fun load(id: ComponentIdentifier): PomContents
}
огда
в самом загрузчике непонятно в какой момент заканчивается «текущая группа».VS
VV
VS
class LicenseDetector(private val loader: PomLoader) {
fun LicenseTag.parse(): License = License.`0BSD`
suspend fun detect(id: ComponentIdentifier): License {
val pom = loader.load(id)
val licenses = pom.licenses
if (licenses != null) {
return licenses.licenses.first().parse()
}
val parentId = pom.parentId ?: TODO("License not found for $id, parent pom is missing as well")
return detect(parentId)
}
}
NN
interface PomLoader {
suspend fun load(id: ComponentIdentifier): PomContents
}
огда
в самом загрузчике непонятно в какой момент заканчивается «текущая группа».