From 38a54455d7b87390724039d3b00f9c91d3bc24d8 Mon Sep 17 00:00:00 2001 From: JFronny Date: Wed, 24 Apr 2024 16:10:17 +0200 Subject: [PATCH] fix(serialize-generator): Print a better error message --- .../commons/serialize/generator/SerializeGeneratorProcessor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/commons-serialize-generator/src/main/java/io/gitlab/jfronny/commons/serialize/generator/SerializeGeneratorProcessor.java b/commons-serialize-generator/src/main/java/io/gitlab/jfronny/commons/serialize/generator/SerializeGeneratorProcessor.java index 252a036..9fe1f1e 100644 --- a/commons-serialize-generator/src/main/java/io/gitlab/jfronny/commons/serialize/generator/SerializeGeneratorProcessor.java +++ b/commons-serialize-generator/src/main/java/io/gitlab/jfronny/commons/serialize/generator/SerializeGeneratorProcessor.java @@ -115,6 +115,7 @@ public class SerializeGeneratorProcessor extends AbstractProcessor2 { case "adapter" -> { if (bld.adapter != null) throw new IllegalArgumentException("Duplicate annotation parameter: adapter"); if (value.getValue() instanceof TypeMirror tm) bld.adapter = tm; + else if (value.getValue() instanceof String s && s.equals("")) throw new IllegalArgumentException("Unexpected value type on " + element + ". Did you forget to import it?"); else throw new IllegalArgumentException("Unexpected value type: " + value.getValue().getClass() + " (with value " + value.getValue() + ") on " + element); } case "nullSafe" -> {