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
This commit is part of merge request !147. Comments created here will be created in the context of that merge request.
...@@ -21,8 +21,7 @@ class PatcherDefinitionFactory { ...@@ -21,8 +21,7 @@ class PatcherDefinitionFactory {
* value of the requiredType. * value of the requiredType.
*/ */
fun createPatcherDefinition(requiredType: String, patcherTypes: List<TypeName>): List<PatcherDefinition> { fun createPatcherDefinition(requiredType: String, patcherTypes: List<TypeName>): List<PatcherDefinition> {
return patcherTypes return patcherTypes.firstOrNull() { type -> type.typeName == requiredType }
.filter { type -> type.typeName == requiredType } ?.patchers ?: throw IllegalArgumentException("typeName $requiredType not found.")
.flatMap { type -> type.patchers }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment