Support for Java 11

This commit is contained in:
Paulo Gustavo Veiga
2020-11-06 21:35:54 -08:00
parent 542c0c33e0
commit ad9cea069a
45 changed files with 240 additions and 232 deletions

View File

@@ -27,6 +27,7 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
@@ -34,11 +35,11 @@ public class JAXBUtils {
private final static Map<String, JAXBContext> context = new HashMap<String, JAXBContext>();
public static Object getMapObject(@NotNull InputStream is, @NotNull final String pakage) throws JAXBException, UnsupportedEncodingException {
public static Object getMapObject(@NotNull InputStream is, @NotNull final String pakage) throws JAXBException {
final JAXBContext context = getInstance(pakage);
final Unmarshaller unmarshaller = context.createUnmarshaller();
final Reader reader = new InputStreamReader(is, "UTF-8");
final Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8);
return unmarshaller.unmarshal(reader);
}