Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ <T extends Annotation> MergedAnnotation<T>[] getAnnotationArray(String attribute
* @see #asAnnotationAttributes(Adapt...)
* @see #asMap(Adapt...)
*/
<T extends Map<String, Object>> T asMap(Function<MergedAnnotation<?>, T> factory, Adapt... adaptations);
<T extends Map<String, ? super Object>> T asMap(Function<MergedAnnotation<?>, T> factory, Adapt... adaptations);

/**
* Create a type-safe synthesized version of this merged annotation that can
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ public Map<String, Object> asMap(Adapt... adaptations) {
}

@Override
public <T extends Map<String, Object>> T asMap(Function<MergedAnnotation<?>, T> factory, Adapt... adaptations) {
public <T extends Map<String, ? super Object>> T asMap(Function<MergedAnnotation<?>, T> factory,
Adapt... adaptations) {

return factory.apply(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ public Map<String, Object> asMap(Adapt... adaptations) {
}

@Override
public <T extends Map<String, Object>> T asMap(Function<MergedAnnotation<?>, T> factory, Adapt... adaptations) {
public <T extends Map<String, ? super Object>> T asMap(Function<MergedAnnotation<?>, T> factory,
Adapt... adaptations) {

T map = factory.apply(this);
Assert.state(map != null, "Factory used to create MergedAnnotation Map must not return null");
AttributeMethods attributes = this.mapping.getAttributes();
Expand Down Expand Up @@ -302,7 +304,7 @@ private Class<?> getTypeForMapOptions(Method attribute, Adapt[] adaptations) {
return Object.class;
}

private <T extends Map<String, Object>> Object adaptValueForMapOptions(Method attribute, Object value,
private <T extends Map<String, ? super Object>> Object adaptValueForMapOptions(Method attribute, Object value,
Class<?> mapType, Function<MergedAnnotation<?>, T> factory, Adapt[] adaptations) {

if (value instanceof MergedAnnotation<?> annotation) {
Expand Down
Loading