fix(weaver-pojo): Prevent StringMapPojoWeaver from weaving entries without @StringMapWeaving

This commit is contained in:
2026-05-24 16:38:15 +02:00
parent 94a69f2607
commit 21749e9d0b
2 changed files with 5 additions and 0 deletions
@@ -41,6 +41,10 @@ public class StringMapPojoWeaver implements TweedPojoWeavingExtension {
public <T> @Nullable ConfigEntry<T> weaveEntry(ActualType<T> valueType, WeavingContext context) {
assert weavingConfigAccess != null;
if (!valueType.isAnnotationPresent(StringMapWeaving.class)) {
return null;
}
List<ActualType<?>> mapTypeParams = valueType.getTypesOfSuperArguments(Map.class);
if (mapTypeParams == null || mapTypeParams.get(0).declaredType() != String.class) {
return null;