Skip to content
Snippets Groups Projects
Commit d6b647c2 authored by Benedikt Wetzel's avatar Benedikt Wetzel Committed by Sören Henning
Browse files

Throw exception if load or resource type not found

parent 728db398
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
......@@ -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