fix(serialize-generator): Additional explicit type check for debugging purposes
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Johannes Frohnmeyer 2024-04-24 15:28:15 +02:00
parent efff813ed6
commit 8db740a9eb
Signed by: Johannes
GPG Key ID: E76429612C2929F4

View File

@ -114,7 +114,8 @@ public class SerializeGeneratorProcessor extends AbstractProcessor2 {
switch (name) {
case "adapter" -> {
if (bld.adapter != null) throw new IllegalArgumentException("Duplicate annotation parameter: adapter");
bld.adapter = (TypeMirror) value.getValue();
if (value.getValue() instanceof TypeMirror tm) bld.adapter = tm;
else throw new IllegalArgumentException("Unexpected value type: " + value.getValue().getClass() + " (with value" + value.getValue() + ")");
}
case "nullSafe" -> {
if (bld.nullSafe != null) throw new IllegalArgumentException("Duplicate annotation parameter: nullSafe");