Skip to content

Commit 27e9db8

Browse files
committed
Fix regression in Jaxb2Marshaller regarding JdkVersion
Issue: SPR-13312
1 parent d8794a1 commit 27e9db8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,15 +583,16 @@ public boolean supports(Type genericType) {
583583
if (JAXBElement.class == parameterizedType.getRawType() &&
584584
parameterizedType.getActualTypeArguments().length == 1) {
585585
boolean isJdk6 = (org.springframework.core.JdkVersion.getMajorJavaVersion() <= org.springframework.core.JdkVersion.JAVA_16);
586+
boolean isJdk7 = (org.springframework.core.JdkVersion.getMajorJavaVersion() >= org.springframework.core.JdkVersion.JAVA_17);
586587
Type typeArgument = parameterizedType.getActualTypeArguments()[0];
587588
if (typeArgument instanceof Class) {
588589
Class<?> classArgument = (Class<?>) typeArgument;
589-
if (isJdk6 && classArgument.isArray()) {
590-
return (isPrimitiveWrapper(classArgument) || isStandardClass(classArgument) ||
591-
supportsInternal(classArgument, false));
590+
if (isJdk7 && classArgument.isArray()) {
591+
return (classArgument.getComponentType() == Byte.TYPE);
592592
}
593593
else {
594-
return (classArgument.getComponentType() == Byte.TYPE);
594+
return (isPrimitiveWrapper(classArgument) || isStandardClass(classArgument) ||
595+
supportsInternal(classArgument, false));
595596
}
596597
}
597598
else if (isJdk6 && typeArgument instanceof GenericArrayType) {

0 commit comments

Comments
 (0)