From d693cf2780cda384dd6dae641a3b100c9e3f4443 Mon Sep 17 00:00:00 2001
From: Michele Bologna <michele.bologna@suse.com>
Date: Thu, 11 Apr 2019 15:05:44 +0200
Subject: [PATCH] Sources updated

---
 src/xmlsec-2.0.7/pom.xml                                   |  2 +-
 .../org/apache/jcp/xml/dsig/internal/dom/DOMX509Data.java  |  4 ++--
 .../security/stax/impl/stax/XMLSecStartElementImpl.java    | 14 ++++++++++----
 .../src/test/java/javax/xml/crypto/test/KeySelectors.java  |  4 ++--
 .../java/javax/xml/crypto/test/dsig/X509KeySelector.java   |  2 +-
 .../security/test/stax/XMLSecurityStreamWriterTest.java    |  2 +-
 6 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/src/xmlsec-2.0.7/pom.xml b/src/xmlsec-2.0.7/pom.xml
index 0f0e034..6adb6cc 100644
--- a/src/xmlsec-2.0.7/pom.xml
+++ b/src/xmlsec-2.0.7/pom.xml
@@ -198,7 +198,7 @@
             <plugin>
                 <groupId>org.jvnet.jaxb2.maven2</groupId>
                 <artifactId>maven-jaxb2-plugin</artifactId>
-                <version>0.12.3</version>
+                <version>0.14.0</version>
                 <executions>
                     <execution>
                         <id>bindings</id>
diff --git a/src/xmlsec-2.0.7/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMX509Data.java b/src/xmlsec-2.0.7/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMX509Data.java
index dcffffe..cf98e3a 100644
--- a/src/xmlsec-2.0.7/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMX509Data.java
+++ b/src/xmlsec-2.0.7/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMX509Data.java
@@ -135,7 +135,7 @@ public final class DOMX509Data extends BaseStructure implements X509Data {
         xwriter.writeStartElement(dsPrefix, "X509Data", XMLSignature.XMLNS);
 
         @SuppressWarnings("unchecked")
-        List<Object> content = x509Data.getContent();
+        List<?> content = x509Data.getContent();
         // append children and preserve order
         for (int i = 0, size = content.size(); i < size; i++) {
             Object object = content.get(i);
@@ -231,7 +231,7 @@ public final class DOMX509Data extends BaseStructure implements X509Data {
         }
         X509Data oxd = (X509Data)o;
 
-        @SuppressWarnings("unchecked") List<Object> ocontent = oxd.getContent();
+        @SuppressWarnings("unchecked") List<?> ocontent = oxd.getContent();
         int size = content.size();
         if (size != ocontent.size()) {
             return false;
diff --git a/src/xmlsec-2.0.7/src/main/java/org/apache/xml/security/stax/impl/stax/XMLSecStartElementImpl.java b/src/xmlsec-2.0.7/src/main/java/org/apache/xml/security/stax/impl/stax/XMLSecStartElementImpl.java
index c63b2a8..5e00078 100644
--- a/src/xmlsec-2.0.7/src/main/java/org/apache/xml/security/stax/impl/stax/XMLSecStartElementImpl.java
+++ b/src/xmlsec-2.0.7/src/main/java/org/apache/xml/security/stax/impl/stax/XMLSecStartElementImpl.java
@@ -26,6 +26,8 @@ import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.Namespace;
 
 import java.io.IOException;
 import java.io.Writer;
@@ -76,12 +78,14 @@ public class XMLSecStartElementImpl extends XMLSecEventBaseImpl implements XMLSe
         return this.elementNamespace;
     }
 
+    @SuppressWarnings("unchecked")
     @Override
-    public Iterator<XMLSecAttribute> getAttributes() {
+    public Iterator<Attribute> getAttributes() {
         if (attributes.isEmpty()) {
             return getEmptyIterator();
         }
-        return attributes.iterator();
+        // Hack to get the code working with JDK9
+        return (Iterator<Attribute>)(Iterator<?>)attributes.iterator();
     }
 
     @Override
@@ -128,12 +132,14 @@ public class XMLSecStartElementImpl extends XMLSecEventBaseImpl implements XMLSe
         }
     }
 
+    @SuppressWarnings("unchecked")
     @Override
-    public Iterator<XMLSecNamespace> getNamespaces() {
+    public Iterator<Namespace> getNamespaces() {
         if (namespaces.isEmpty()) {
             return getEmptyIterator();
         }
-        return namespaces.iterator();
+        // Hack to get the code working with JDK9
+        return (Iterator<Namespace>)(Iterator<?>)namespaces.iterator();
     }
 
     @Override
diff --git a/src/xmlsec-2.0.7/src/test/java/javax/xml/crypto/test/KeySelectors.java b/src/xmlsec-2.0.7/src/test/java/javax/xml/crypto/test/KeySelectors.java
index c8ad4f5..5445330 100644
--- a/src/xmlsec-2.0.7/src/test/java/javax/xml/crypto/test/KeySelectors.java
+++ b/src/xmlsec-2.0.7/src/test/java/javax/xml/crypto/test/KeySelectors.java
@@ -111,7 +111,7 @@ public class KeySelectors {
                         }
                     }
                     @SuppressWarnings("unchecked")
-                    Iterator<Object> xi = xd.getContent().iterator();
+                    Iterator<?> xi = xd.getContent().iterator();
                     while (xi.hasNext()) {
                         Object o = xi.next();
                         // skip non-X509Certificate entries
@@ -310,7 +310,7 @@ public class KeySelectors {
                         }
                     } else if (xmlStructure instanceof X509Data) {
                         @SuppressWarnings("unchecked")
-                        List<Object> content = ((X509Data)xmlStructure).getContent();
+                        List<?> content = ((X509Data)xmlStructure).getContent();
                         int size = content.size();
                         List<X509Certificate> result = null;
                         // Lookup the public key using the information
diff --git a/src/xmlsec-2.0.7/src/test/java/javax/xml/crypto/test/dsig/X509KeySelector.java b/src/xmlsec-2.0.7/src/test/java/javax/xml/crypto/test/dsig/X509KeySelector.java
index 8d2ed03..b505f91 100644
--- a/src/xmlsec-2.0.7/src/test/java/javax/xml/crypto/test/dsig/X509KeySelector.java
+++ b/src/xmlsec-2.0.7/src/test/java/javax/xml/crypto/test/dsig/X509KeySelector.java
@@ -307,7 +307,7 @@ public class X509KeySelector extends KeySelector {
         Collection<X509Certificate> certs = new ArrayList<X509Certificate>();
 
         @SuppressWarnings("unchecked")
-        Iterator<Object> xi = xd.getContent().iterator();
+        Iterator<?> xi = xd.getContent().iterator();
         while (xi.hasNext()) {
             Object o = xi.next();
             // check X509IssuerSerial
diff --git a/src/xmlsec-2.0.7/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamWriterTest.java b/src/xmlsec-2.0.7/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamWriterTest.java
index 010475d..e3b9b73 100644
--- a/src/xmlsec-2.0.7/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamWriterTest.java
+++ b/src/xmlsec-2.0.7/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamWriterTest.java
@@ -83,7 +83,7 @@ public class XMLSecurityStreamWriterTest extends Assert {
             }
 
             @Override
-            public Iterator<?> getPrefixes(String namespaceURI) {
+            public Iterator<String> getPrefixes(String namespaceURI) {
                 List<String> ns = new ArrayList<String>();
                 ns.add(getPrefix(namespaceURI));
                 return ns.iterator();
-- 
2.16.4

