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
+1
View File
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- `core`: Fixed return type of `MutableStructuredConfigEntry#apply` to correctly be itself.
- `weaver-pojo`: Fixed `StringMapPojoWeaver` weaving entries without `@StringMapWeaving` annotation.
## [0.8.1] - 2026-04-26
@@ -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;