Skip to content

Commit 9b71ba7

Browse files
committed
PMD fixes
1 parent 0791fc5 commit 9b71ba7

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -663,14 +663,13 @@ private static Data copyDerefData(Data dereferencedData) {
663663

664664
private static void close(Closeable... closeables) throws XMLSignatureException {
665665
XMLSignatureException collector = new XMLSignatureException("Close failed!");
666-
for (Closeable closeable : closeables) {
667-
if (closeable == null) {
668-
continue;
669-
}
670-
try {
671-
closeable.close();
672-
} catch (IOException e) {
673-
collector.addSuppressed(e);
666+
for (Closeable closeable : closeables) { //NOPMD
667+
if (closeable != null) {
668+
try {
669+
closeable.close();
670+
} catch (IOException e) {
671+
collector.addSuppressed(e);
672+
}
674673
}
675674
}
676675
if (collector.getSuppressed().length > 0) {

src/test/java/org/apache/xml/security/test/dom/algorithms/SignatureAlgorithmTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void testSameKeySeveralAlgorithmSigning() throws Exception {
103103
@Test
104104
void testConstructionWithProvider() throws Exception {
105105
Field algorithmHashField = SignatureAlgorithm.class.getDeclaredField("algorithmHash");
106-
algorithmHashField.setAccessible(true);
106+
algorithmHashField.setAccessible(true); //NOPMD
107107
@SuppressWarnings("unchecked")
108108
Map<String, Class<?>> algorithmHash = (Map<String, Class<?>>)algorithmHashField.get(null);
109109
assertFalse(algorithmHash.isEmpty());

0 commit comments

Comments
 (0)