Remove JDK 9 workarounds etc

See gh-17778
This commit is contained in:
Juergen Hoeller
2021-09-17 08:58:19 +02:00
parent e0a4b05142
commit b74e93807e
15 changed files with 36 additions and 77 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -122,7 +122,6 @@ public class XmlEventDecoder extends AbstractDecoder<XMLEvent> {
@Override
@SuppressWarnings({"rawtypes", "unchecked", "cast"}) // XMLEventReader is Iterator<Object> on JDK 9
public Flux<XMLEvent> decode(Publisher<DataBuffer> input, ResolvableType elementType,
@Nullable MimeType mimeType, @Nullable Map<String, Object> hints) {
@@ -137,7 +136,7 @@ public class XmlEventDecoder extends AbstractDecoder<XMLEvent> {
.flatMapIterable(buffer -> {
try {
InputStream is = buffer.asInputStream();
Iterator eventReader = inputFactory.createXMLEventReader(is);
Iterator<Object> eventReader = inputFactory.createXMLEventReader(is);
List<XMLEvent> result = new ArrayList<>();
eventReader.forEachRemaining(event -> result.add((XMLEvent) event));
return result;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -197,7 +197,7 @@ public class SourceHttpMessageConverter<T extends Source> extends AbstractHttpMe
}
}
@SuppressWarnings("deprecation") // on JDK 9
@SuppressWarnings("deprecation")
private SAXSource readSAXSource(InputStream body, HttpInputMessage inputMessage) throws IOException {
try {
XMLReader xmlReader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();