Tighten up StreamWriterWithDisabledValidation 98/103198/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 10 Nov 2022 16:46:25 +0000 (17:46 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 10 Nov 2022 16:46:25 +0000 (17:46 +0100)
We provide couple of methods which are not overridden -- make sure they
are final.

Change-Id: Iffd7cc99c191d89261a74aaed4121c66151c3841
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/StreamWriterWithDisabledValidation.java

index c5c6568890702c59fe365801e872f6189f2913d4..611f08c747e18883ea6fd4c8e9127d724fb44702 100644 (file)
@@ -20,8 +20,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.stream.ForwardingNormaliz
  * we override the leafNode behavior for error-info.
  */
 abstract class StreamWriterWithDisabledValidation extends ForwardingNormalizedNodeStreamWriter {
-
     private final QName excludedQName;
+
     private boolean inOurLeaf;
 
     /**
@@ -34,7 +34,7 @@ abstract class StreamWriterWithDisabledValidation extends ForwardingNormalizedNo
     }
 
     @Override
-    public void startLeafNode(final NodeIdentifier name) throws IOException {
+    public final void startLeafNode(final NodeIdentifier name) throws IOException {
         if (name.getNodeType().equals(excludedQName)) {
             inOurLeaf = true;
             startLeafNodeWithDisabledValidation(name);
@@ -52,7 +52,7 @@ abstract class StreamWriterWithDisabledValidation extends ForwardingNormalizedNo
     abstract void startLeafNodeWithDisabledValidation(NodeIdentifier nodeIdentifier) throws IOException;
 
     @Override
-    public void scalarValue(final Object value) throws IOException {
+    public final void scalarValue(final Object value) throws IOException {
         if (inOurLeaf) {
             scalarValueWithDisabledValidation(value);
         } else {
@@ -69,7 +69,7 @@ abstract class StreamWriterWithDisabledValidation extends ForwardingNormalizedNo
     abstract void scalarValueWithDisabledValidation(Object value) throws IOException;
 
     @Override
-    public void endNode() throws IOException {
+    public final void endNode() throws IOException {
         if (inOurLeaf) {
             inOurLeaf = false;
             endNodeWithDisabledValidation();