aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2021-09-13 01:47:08 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2021-09-29 17:13:06 +0200
commit1aa19c67e691d62f3d9560fec0cfe7f5443d6497 (patch)
treef7777c73569eac537477b75651bf082858a5e1fa /org.eclipse.jgit/src/org/eclipse/jgit
parent81771d86258891ca384b046f70b9d331fe9ab4a6 (diff)
downloadjgit-1aa19c67e691d62f3d9560fec0cfe7f5443d6497.tar.gz
jgit-1aa19c67e691d62f3d9560fec0cfe7f5443d6497.zip
Replace XMLReaderFactory deprecated since Java 9
Change-Id: Ie8a9d411fc19e8b7bf86c0b4df0b02153a0e9444
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java10
2 files changed, 11 insertions, 7 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java
index 6a2c3898a6..aa69a05112 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java
@@ -24,6 +24,9 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+
import org.eclipse.jgit.annotations.NonNull;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.gitrepo.RepoProject.CopyFile;
@@ -37,7 +40,6 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.helpers.XMLReaderFactory;
/**
* Repo XML manifest parser.
@@ -137,8 +139,8 @@ public class ManifestParser extends DefaultHandler {
xmlInRead++;
final XMLReader xr;
try {
- xr = XMLReaderFactory.createXMLReader();
- } catch (SAXException e) {
+ xr = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
+ } catch (SAXException | ParserConfigurationException e) {
throw new IOException(JGitText.get().noXMLParserAvailable, e);
}
xr.setContentHandler(this);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
index 9210ec1721..d56b5b320d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
@@ -31,6 +31,7 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
+import java.time.Instant;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -46,10 +47,11 @@ import java.util.SortedMap;
import java.util.TimeZone;
import java.util.TreeMap;
import java.util.stream.Collectors;
-import java.time.Instant;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.Constants;
@@ -64,7 +66,6 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.helpers.XMLReaderFactory;
/**
* A simple HTTP REST client for the Amazon S3 service.
@@ -683,8 +684,9 @@ public class AmazonS3 {
final XMLReader xr;
try {
- xr = XMLReaderFactory.createXMLReader();
- } catch (SAXException e) {
+ xr = SAXParserFactory.newInstance().newSAXParser()
+ .getXMLReader();
+ } catch (SAXException | ParserConfigurationException e) {
throw new IOException(
JGitText.get().noXMLParserAvailable, e);
}