fix(weaver-pojo): Prevent StringMapPojoWeaver from weaving entries without @StringMapWeaving
This commit is contained in:
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- `core`: Fixed return type of `MutableStructuredConfigEntry#apply` to correctly be itself.
|
- `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
|
## [0.8.1] - 2026-04-26
|
||||||
|
|
||||||
|
|||||||
+4
@@ -41,6 +41,10 @@ public class StringMapPojoWeaver implements TweedPojoWeavingExtension {
|
|||||||
public <T> @Nullable ConfigEntry<T> weaveEntry(ActualType<T> valueType, WeavingContext context) {
|
public <T> @Nullable ConfigEntry<T> weaveEntry(ActualType<T> valueType, WeavingContext context) {
|
||||||
assert weavingConfigAccess != null;
|
assert weavingConfigAccess != null;
|
||||||
|
|
||||||
|
if (!valueType.isAnnotationPresent(StringMapWeaving.class)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
List<ActualType<?>> mapTypeParams = valueType.getTypesOfSuperArguments(Map.class);
|
List<ActualType<?>> mapTypeParams = valueType.getTypesOfSuperArguments(Map.class);
|
||||||
if (mapTypeParams == null || mapTypeParams.get(0).declaredType() != String.class) {
|
if (mapTypeParams == null || mapTypeParams.get(0).declaredType() != String.class) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user