Skip to content
Snippets Groups Projects
Commit 806191c8 authored by Sören Henning's avatar Sören Henning
Browse files

Merge branch '231-throw-excpetion-for-incorrect-load-resource-types' into 'theodolite-kotlin'

Throw execption, if load or resource type not found

See merge request !147
parents 728db398 d6b647c2
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!147Throw execption, if load or resource type not found,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
Pipeline #3527 passed
......@@ -21,8 +21,7 @@ class PatcherDefinitionFactory {
* value of the requiredType.
*/
fun createPatcherDefinition(requiredType: String, patcherTypes: List<TypeName>): List<PatcherDefinition> {
return patcherTypes
.filter { type -> type.typeName == requiredType }
.flatMap { type -> type.patchers }
return patcherTypes.firstOrNull() { type -> type.typeName == requiredType }
?.patchers ?: throw IllegalArgumentException("typeName $requiredType not found.")
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment