From 43674bdb541df3322b67994901fe2c73f3f82682 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 3 Sep 2019 09:20:52 +0200 Subject: [PATCH] Fix checkstyle Updated checkstyle is finding some issues, fix them up. Change-Id: Id17bc94b4fdd2b8883dedc5e8736f9e1971aa900 Signed-off-by: Robert Varga (cherry picked from commit 1cb9037cc1a5e94001710d184748e0f752aec672) --- .../netconf/api/xml/XmlNetconfConstants.java | 3 ++- .../netconf/util/NetconfUtil.java | 4 +++- .../util/messages/NetconfMessageUtil.java | 4 +++- .../util/messages/SendErrorExceptionUtil.java | 4 +++- .../netconf/util/test/XmlUnitUtil.java | 19 ++++++++++--------- .../util/NetconfMessageTransformUtil.java | 4 +++- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/XmlNetconfConstants.java b/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/XmlNetconfConstants.java index fa9ceececd..3b45aad1cc 100644 --- a/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/XmlNetconfConstants.java +++ b/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/XmlNetconfConstants.java @@ -8,8 +8,9 @@ package org.opendaylight.netconf.api.xml; public final class XmlNetconfConstants { + private XmlNetconfConstants() { - private XmlNetconfConstants() {} + } public static final String CAPABILITY = "capability"; public static final String CAPABILITIES = "capabilities"; diff --git a/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/NetconfUtil.java b/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/NetconfUtil.java index eb3613534a..d47c86d10a 100644 --- a/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/NetconfUtil.java +++ b/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/NetconfUtil.java @@ -40,7 +40,9 @@ public final class NetconfUtil { XML_FACTORY.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, false); } - private NetconfUtil() {} + private NetconfUtil() { + + } public static Document checkIsMessageOk(final Document response) throws DocumentedException { XmlElement element = XmlElement.fromDomDocument(response); diff --git a/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageUtil.java b/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageUtil.java index a0c2db36c4..78ba588ad4 100644 --- a/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageUtil.java +++ b/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageUtil.java @@ -25,7 +25,9 @@ public final class NetconfMessageUtil { private static final Logger LOG = LoggerFactory.getLogger(NetconfMessageUtil.class); - private NetconfMessageUtil() {} + private NetconfMessageUtil() { + + } public static boolean isOKMessage(final NetconfMessage message) throws NetconfDocumentedException { return isOKMessage(message.getDocument()); diff --git a/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java b/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java index 11ad160a26..4f93674224 100644 --- a/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java +++ b/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java @@ -28,7 +28,9 @@ import org.w3c.dom.NamedNodeMap; public final class SendErrorExceptionUtil { private static final Logger LOG = LoggerFactory.getLogger(SendErrorExceptionUtil.class); - private SendErrorExceptionUtil() {} + private SendErrorExceptionUtil() { + + } public static void sendErrorMessage(final NetconfSession session, final DocumentedException sendErrorException) { diff --git a/netconf/netconf-util/src/test/java/org/opendaylight/netconf/util/test/XmlUnitUtil.java b/netconf/netconf-util/src/test/java/org/opendaylight/netconf/util/test/XmlUnitUtil.java index 78fc364032..f774213a03 100644 --- a/netconf/netconf-util/src/test/java/org/opendaylight/netconf/util/test/XmlUnitUtil.java +++ b/netconf/netconf-util/src/test/java/org/opendaylight/netconf/util/test/XmlUnitUtil.java @@ -23,8 +23,9 @@ import org.w3c.dom.Node; import org.w3c.dom.Text; public final class XmlUnitUtil { + private XmlUnitUtil() { - private XmlUnitUtil() {} + } public static void assertContainsElementWithText(final Document doc, final String textToFind) throws NodeTestException { @@ -34,7 +35,7 @@ public final class XmlUnitUtil { boolean textFound = false; @Override - public void testText(Text text) throws NodeTestException { + public void testText(final Text text) throws NodeTestException { if (!textFound) { if (text.getData().equalsIgnoreCase(textToFind)) { textFound = true; @@ -43,7 +44,7 @@ public final class XmlUnitUtil { } @Override - public void noMoreNodes(NodeTest forTest) throws NodeTestException { + public void noMoreNodes(final NodeTest forTest) throws NodeTestException { assertTrue(textFound); } }; @@ -57,7 +58,7 @@ public final class XmlUnitUtil { private boolean elementFound = false; @Override - public void testElement(Element element) throws NodeTestException { + public void testElement(final Element element) throws NodeTestException { if (!elementFound) { if (element.isEqualNode(testElement)) { elementFound = true; @@ -66,7 +67,7 @@ public final class XmlUnitUtil { } @Override - public void noMoreNodes(NodeTest forTest) throws NodeTestException { + public void noMoreNodes(final NodeTest forTest) throws NodeTestException { assertTrue(elementFound); } }; @@ -81,7 +82,7 @@ public final class XmlUnitUtil { private boolean elementFound = false; @Override - public void testElement(Element element) throws NodeTestException { + public void testElement(final Element element) throws NodeTestException { if (!elementFound) { if (element.getNodeName() != null && element.getNodeName().equals(elementName)) { elementFound = true; @@ -90,7 +91,7 @@ public final class XmlUnitUtil { } @Override - public void noMoreNodes(NodeTest forTest) throws NodeTestException { + public void noMoreNodes(final NodeTest forTest) throws NodeTestException { assertTrue(XmlUtil.toString(doc), elementFound); } }; @@ -104,14 +105,14 @@ public final class XmlUnitUtil { private int elementFound = 0; @Override - public void testElement(Element element) throws NodeTestException { + public void testElement(final Element element) throws NodeTestException { if (element.getNodeName() != null && element.getNodeName().equals(elementName)) { elementFound++; } } @Override - public void noMoreNodes(NodeTest forTest) throws NodeTestException { + public void noMoreNodes(final NodeTest forTest) throws NodeTestException { assertEquals(expectedCount, elementFound); } }; diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfMessageTransformUtil.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfMessageTransformUtil.java index a0c8ca7ef9..83d903b686 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfMessageTransformUtil.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfMessageTransformUtil.java @@ -88,7 +88,9 @@ public final class NetconfMessageTransformUtil { private static final Document BLANK_DOCUMENT = XmlUtil.newDocument(); public static final String EVENT_TIME = "eventTime"; - private NetconfMessageTransformUtil() {} + private NetconfMessageTransformUtil() { + + } public static final QName IETF_NETCONF_MONITORING = QName.create(NetconfState.QNAME, "ietf-netconf-monitoring").intern(); -- 2.36.6