Skip to content

Commit 30fb950

Browse files
committed
Fix error on Jaxb2RootElementHttpMessageConverter
Can encode can now support child class of JAXBElement
1 parent e547313 commit 30fb950

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public boolean canRead(Class<?> clazz, @Nullable MediaType mediaType) {
121121

122122
@Override
123123
public boolean canWrite(Class<?> clazz, @Nullable MediaType mediaType) {
124-
boolean supportedType = (JAXBElement.class.isAssignableFrom(clazz) ||
124+
boolean supportedType = (clazz.isAssignableFrom(JAXBElement.class) ||
125125
AnnotationUtils.findAnnotation(clazz, XmlRootElement.class) != null);
126126
return (supportedType && canWrite(mediaType));
127127
}

0 commit comments

Comments
 (0)