Fix regression in Jaxb2Marshaller regarding JdkVersion
Issue: SPR-13312
This commit is contained in:
@@ -583,15 +583,16 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
|
|||||||
if (JAXBElement.class == parameterizedType.getRawType() &&
|
if (JAXBElement.class == parameterizedType.getRawType() &&
|
||||||
parameterizedType.getActualTypeArguments().length == 1) {
|
parameterizedType.getActualTypeArguments().length == 1) {
|
||||||
boolean isJdk6 = (org.springframework.core.JdkVersion.getMajorJavaVersion() <= org.springframework.core.JdkVersion.JAVA_16);
|
boolean isJdk6 = (org.springframework.core.JdkVersion.getMajorJavaVersion() <= org.springframework.core.JdkVersion.JAVA_16);
|
||||||
|
boolean isJdk7 = (org.springframework.core.JdkVersion.getMajorJavaVersion() >= org.springframework.core.JdkVersion.JAVA_17);
|
||||||
Type typeArgument = parameterizedType.getActualTypeArguments()[0];
|
Type typeArgument = parameterizedType.getActualTypeArguments()[0];
|
||||||
if (typeArgument instanceof Class) {
|
if (typeArgument instanceof Class) {
|
||||||
Class<?> classArgument = (Class<?>) typeArgument;
|
Class<?> classArgument = (Class<?>) typeArgument;
|
||||||
if (isJdk6 && classArgument.isArray()) {
|
if (isJdk7 && classArgument.isArray()) {
|
||||||
return (isPrimitiveWrapper(classArgument) || isStandardClass(classArgument) ||
|
return (classArgument.getComponentType() == Byte.TYPE);
|
||||||
supportsInternal(classArgument, false));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return (classArgument.getComponentType() == Byte.TYPE);
|
return (isPrimitiveWrapper(classArgument) || isStandardClass(classArgument) ||
|
||||||
|
supportsInternal(classArgument, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isJdk6 && typeArgument instanceof GenericArrayType) {
|
else if (isJdk6 && typeArgument instanceof GenericArrayType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user