Consistent deprecation markers on JDK 9

This commit is contained in:
Juergen Hoeller
2017-01-13 10:53:20 +01:00
parent 08c2fd4e7c
commit 1cb381e9a7
7 changed files with 35 additions and 29 deletions

View File

@@ -100,8 +100,7 @@ import org.springframework.util.StringUtils;
import org.springframework.util.xml.StaxUtils;
/**
* Implementation of the {@code GenericMarshaller} interface for JAXB 2.1/2.2,
* as included in JDK 6 update 4+ and Java 7/8.
* Implementation of the {@code GenericMarshaller} interface for JAXB 2.2.
*
* <p>The typical usage will be to set either the "contextPath" or the "classesToBeBound"
* property on this bean, possibly customize the marshaller and unmarshaller by setting
@@ -544,6 +543,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
}
@SuppressWarnings("deprecation") // on JDK 9
private Schema loadSchema(Resource[] resources, String schemaLanguage) throws IOException, SAXException {
if (logger.isDebugEnabled()) {
logger.debug("Setting validation schema to " +
@@ -588,7 +588,6 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
supportsInternal(classArgument, false));
}
else if (typeArgument instanceof GenericArrayType) {
// Only on JDK 6 - see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041784
GenericArrayType arrayType = (GenericArrayType) typeArgument;
return (Byte.TYPE == arrayType.getGenericComponentType());
}
@@ -773,9 +772,8 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
catch (NullPointerException ex) {
if (!isSupportDtd()) {
throw new UnmarshallingFailureException("NPE while unmarshalling. " +
"This can happen on JDK 1.6 due to the presence of DTD " +
"declarations, which are disabled.", ex);
throw new UnmarshallingFailureException("NPE while unmarshalling: " +
"This can happen due to the presence of DTD declarations which are disabled.", ex);
}
throw ex;
}
@@ -804,6 +802,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
}
@SuppressWarnings("deprecation") // on JDK 9
private Source processSource(Source source) {
if (StaxUtils.isStaxSource(source) || source instanceof DOMSource) {
return source;

View File

@@ -183,6 +183,7 @@ public abstract class AbstractMarshaller implements Marshaller, Unmarshaller {
* @return the XMLReader
* @throws SAXException if thrown by JAXP methods
*/
@SuppressWarnings("deprecation") // on JDK 9
protected XMLReader createXmlReader() throws SAXException {
XMLReader xmlReader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
xmlReader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", !isSupportDtd());