Skip to content

Commit

Permalink
Remove find(sourceSetID: DokkaSourceSetID)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Jan 20, 2023
1 parent d854002 commit 36eb341
Showing 1 changed file with 6 additions and 9 deletions.
Expand Up @@ -88,13 +88,9 @@ abstract class KotlinAnalysis(
?: throw IllegalStateException("Missing EnvironmentAndFacade for sourceSet ${key}")
}

operator fun get(sourceSetID: DokkaSourceSetID): AnalysisContext {
return find(sourceSetID)
?: parent?.get(sourceSetID)
?: throw IllegalStateException("Missing EnvironmentAndFacade for sourceSet ${sourceSetID.sourceSetName}")
}
@Deprecated("sourceSetID can be non unique")
protected abstract fun get(sourceSetID: DokkaSourceSetID): AnalysisContext

protected abstract fun find(sourceSetID: DokkaSourceSetID): AnalysisContext?
protected abstract fun find(sourceSet: DokkaSourceSet): AnalysisContext?
}

Expand All @@ -103,9 +99,10 @@ internal open class EnvironmentKotlinAnalysis(
parent: KotlinAnalysis? = null,
) : KotlinAnalysis(parent = parent) {

override fun find(sourceSetID: DokkaSourceSetID): AnalysisContext? {
return environments.entries.firstOrNull { (sourceSet, _) -> sourceSet.sourceSetID == sourceSetID }?.value
}
@Deprecated("sourceSetID can be non unique")
override fun get(sourceSetID: DokkaSourceSetID): AnalysisContext =
this[environments.keys.firstOrNull { sourceSet -> sourceSet.sourceSetID == sourceSetID } ?: throw IllegalStateException("Unknown ${sourceSetID}")]


override fun find(sourceSet: DokkaSourceSet): AnalysisContext? {
return environments[sourceSet]
Expand Down

0 comments on commit 36eb341

Please sign in to comment.