From 648e50f5456d25466588fc4d40a139163d9b0708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kurzyd=C5=82owski?= Date: Tue, 11 Oct 2022 11:48:08 +0200 Subject: [PATCH] Checkstyle fixes --- .../registryclient/CatalogueDocument.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/eu/erasmuswithoutpaper/registryclient/CatalogueDocument.java b/src/main/java/eu/erasmuswithoutpaper/registryclient/CatalogueDocument.java index 516cce5..b4a1f3f 100644 --- a/src/main/java/eu/erasmuswithoutpaper/registryclient/CatalogueDocument.java +++ b/src/main/java/eu/erasmuswithoutpaper/registryclient/CatalogueDocument.java @@ -264,7 +264,7 @@ public Iterator getPrefixes(String namespaceUri) { "r:host", root, XPathConstants.NODESET)); for (Element hostElem : elements) { - List children = Utils.asNodeList((NodeList) hostElem.getChildNodes()); + List children = Utils.asNodeList(hostElem.getChildNodes()); Node institutionsCovered = null; Node clientCredentials = null; Node serverCredentials = null; @@ -281,7 +281,7 @@ public Iterator getPrefixes(String namespaceUri) { Set coveredHeis = new HashSet<>(); if (institutionsCovered != null) { - List heiNodes = Utils.asNodeList((NodeList) institutionsCovered.getChildNodes()); + List heiNodes = Utils.asNodeList(institutionsCovered.getChildNodes()); for (Node heiIdNode : heiNodes) { if ("hei-id".equals(heiIdNode.getLocalName())) { coveredHeis.add(heiIdNode.getTextContent()); @@ -297,10 +297,12 @@ public Iterator getPrefixes(String namespaceUri) { this.hostServerKeys.put(hostElem, keys); if (clientCredentials != null) { - List credentialNodes = Utils.asNodeList((NodeList) clientCredentials.getChildNodes()); + List credentialNodes = + Utils.asNodeList(clientCredentials.getChildNodes()); for (Node credential : credentialNodes) { if ("certificate".equals(credential.getLocalName())) { - String fingerprint = credential.getAttributes().getNamedItem("sha-256").getTextContent(); + String fingerprint = + credential.getAttributes().getNamedItem("sha-256").getTextContent(); Set coveredCertHeis; @@ -314,7 +316,8 @@ public Iterator getPrefixes(String namespaceUri) { coveredCertHeis.addAll(coveredHeis); } else if ("rsa-public-key".equals(credential.getLocalName())) { - String fingerprint = credential.getAttributes().getNamedItem("sha-256").getTextContent(); + String fingerprint = + credential.getAttributes().getNamedItem("sha-256").getTextContent(); Set coveredKeyHeis; if (this.cliKeyHeis.containsKey(fingerprint)) { coveredKeyHeis = this.cliKeyHeis.get(fingerprint); @@ -328,10 +331,12 @@ public Iterator getPrefixes(String namespaceUri) { } if (serverCredentials != null) { - List credentialNodes = Utils.asNodeList((NodeList) serverCredentials.getChildNodes()); + List credentialNodes = + Utils.asNodeList(serverCredentials.getChildNodes()); for (Node credential : credentialNodes) { if ("rsa-public-key".equals(credential.getLocalName())) { - String fingerprint = credential.getAttributes().getNamedItem("sha-256").getTextContent(); + String fingerprint = + credential.getAttributes().getNamedItem("sha-256").getTextContent(); keys.add(fingerprint); } } @@ -828,7 +833,6 @@ public boolean isStale() { } } - @SuppressWarnings("serial") static class CatalogueParserException extends RegistryClientException { CatalogueParserException(String message) { super(message);