[java-opensaml] 02/02: Minor code cleanup.
Brent Putman
putmanb at georgetown.edu
Fri Oct 2 03:10:39 UTC 2020
This is an automated email from the git hooks/post-receive script.
putmanb pushed a commit to branch main
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=76939a5d5c3084b0bc56e88bb8226ad2fb36fd1c
commit 76939a5d5c3084b0bc56e88bb8226ad2fb36fd1c
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Thu Oct 1 23:10:10 2020 -0400
Minor code cleanup.
---
.../src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java | 1 +
.../test/java/org/opensaml/core/xml/util/XMLObjectSupportTest.java | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java b/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java
index 44574bc3d..e8e69bcb7 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java
@@ -169,6 +169,7 @@ public final class XMLObjectSupport {
+ QNameSupport.getNodeQName(clonedElement));
}
+ @SuppressWarnings("unchecked")
final T clonedXMLObject = (T) unmarshaller.unmarshall(clonedElement);
if (CloneOutputOption.DropDOM.equals(cloneOutputOption)) {
clonedXMLObject.releaseDOM();
diff --git a/opensaml-core/src/test/java/org/opensaml/core/xml/util/XMLObjectSupportTest.java b/opensaml-core/src/test/java/org/opensaml/core/xml/util/XMLObjectSupportTest.java
index 9f9692570..fa43bd44d 100644
--- a/opensaml-core/src/test/java/org/opensaml/core/xml/util/XMLObjectSupportTest.java
+++ b/opensaml-core/src/test/java/org/opensaml/core/xml/util/XMLObjectSupportTest.java
@@ -63,7 +63,7 @@ public class XMLObjectSupportTest extends XMLObjectBaseTestCase {
Assert.assertNull(clonedParentObj.getDOM(), "Cloned parent DOM node was not null");
Assert.assertFalse(clonedParentObj.getSimpleXMLObjects().isEmpty(), "Cloned parent had no children");
- SimpleXMLObject clonedChildObj = (SimpleXMLObject) clonedParentObj.getSimpleXMLObjects().get(0);
+ SimpleXMLObject clonedChildObj = clonedParentObj.getSimpleXMLObjects().get(0);
Assert.assertFalse(origChildObj == clonedChildObj, "Child XMLObjects were the same reference");
Assert.assertNull(clonedChildObj.getDOM(), "Cloned child DOM node was not null");
@@ -98,7 +98,7 @@ public class XMLObjectSupportTest extends XMLObjectBaseTestCase {
"Parent DOM node was not cloned properly");
Assert.assertFalse(clonedParentObj.getSimpleXMLObjects().isEmpty(), "Cloned parent had no children");
- SimpleXMLObject clonedChildObj = (SimpleXMLObject) clonedParentObj.getSimpleXMLObjects().get(0);
+ SimpleXMLObject clonedChildObj = clonedParentObj.getSimpleXMLObjects().get(0);
Assert.assertFalse(origChildObj == clonedChildObj, "Child XMLObjects were the same reference");
Assert.assertNotNull(clonedChildObj.getDOM(), "Cloned child DOM node was null");
@@ -135,7 +135,7 @@ public class XMLObjectSupportTest extends XMLObjectBaseTestCase {
"Parent DOM node was not cloned properly");
Assert.assertFalse(clonedParentObj.getSimpleXMLObjects().isEmpty(), "Cloned parent had no children");
- SimpleXMLObject clonedChildObj = (SimpleXMLObject) clonedParentObj.getSimpleXMLObjects().get(0);
+ SimpleXMLObject clonedChildObj = clonedParentObj.getSimpleXMLObjects().get(0);
Assert.assertFalse(origChildObj == clonedChildObj, "Child XMLObjects were the same reference");
Assert.assertNotNull(clonedChildObj.getDOM(), "Cloned child DOM node was null");
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list