From fedba3cac1c141c2b2bfb61ccf8a5622977254d4 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 29 Dec 2023 10:56:46 +0100 Subject: [PATCH] Bump upstreams Adopt: - odparent-13.0.10 - infrautils-6.0.5 - yangtools-11.0.5 - mdsal-12.0.4 - controller-8.0.4 - aaa-0.18.4 Change-Id: I8c5b540fd07ce872b97bd4d37d9cf493a30c1777 Signed-off-by: Robert Varga --- .../impl/actors/NetconfNodeActor.java | 6 ++--- apps/pom.xml | 2 +- artifacts/pom.xml | 2 +- .../features-netconf-experimental/pom.xml | 2 +- features/features-netconf-testing/pom.xml | 2 +- features/features-netconf/pom.xml | 2 +- features/parent/pom.xml | 2 +- features/pom.xml | 2 +- karaf-static/pom.xml | 2 +- karaf/pom.xml | 6 ++--- keystore/pom.xml | 2 +- model/pom.xml | 2 +- netconf/pom.xml | 2 +- .../stress/AbstractExecutionStrategy.java | 22 +++++++++---------- .../test/tool/client/stress/Parameters.java | 3 ++- netconf/tools/pom.xml | 2 +- parent/pom.xml | 8 +++---- .../mdsal/NetconfDeviceCommunicator.java | 2 ++ plugins/pom.xml | 2 +- pom.xml | 2 +- .../operations/DefaultCloseSession.java | 2 +- .../mapping/operations/DefaultStartExi.java | 3 ++- .../mapping/operations/DefaultStopExi.java | 3 ++- protocol/pom.xml | 2 +- restconf/pom.xml | 2 +- .../nb/rfc8040/databind/AbstractBody.java | 2 ++ .../nb/rfc8040/databind/JsonResourceBody.java | 20 +++++++++++++++++ .../restconf/server/api/DatabindContext.java | 4 ++++ .../server/mdsal/MdsalRestconfServer.java | 2 ++ .../restconf/server/spi/RestconfStream.java | 2 ++ .../databind/JsonResourceBodyTest.java | 11 +++++----- .../rfc8040/databind/XmlResourceBodyTest.java | 10 +++++---- restconf/sal-rest-connector-config/pom.xml | 2 +- restconf/websocket-client/pom.xml | 1 - .../client/WebSocketSessionHandler.java | 3 +-- third-party/pom.xml | 2 +- third-party/shaded-exificient-jar/pom.xml | 2 +- third-party/shaded-exificient/pom.xml | 2 +- third-party/shaded-sshd-jar/pom.xml | 2 +- third-party/shaded-sshd/pom.xml | 2 +- transport/pom.xml | 2 +- .../transport/ssh/TransportServerSession.java | 2 ++ truststore/pom.xml | 2 +- 43 files changed, 99 insertions(+), 61 deletions(-) diff --git a/apps/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java b/apps/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java index f8a656e007..679c63bfbc 100644 --- a/apps/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java +++ b/apps/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java @@ -88,9 +88,9 @@ public class NetconfNodeActor extends AbstractUntypedActor { private Timeout actorResponseWaitTime; private RemoteDeviceId id; private NetconfTopologySetup setup; - private List sourceIdentifiers; - private DOMRpcService deviceRpc; - private DOMActionService deviceAction; + private List sourceIdentifiers = null; + private DOMRpcService deviceRpc = null; + private DOMActionService deviceAction = null; private SlaveSalFacade slaveSalManager; private DOMDataBroker deviceDataBroker; private NetconfDataTreeService netconfService; diff --git a/apps/pom.xml b/apps/pom.xml index ea39c8b136..aaf3b265bf 100644 --- a/apps/pom.xml +++ b/apps/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/artifacts/pom.xml b/artifacts/pom.xml index fa69e394a5..e36f3940e5 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -14,7 +14,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/features/features-netconf-experimental/pom.xml b/features/features-netconf-experimental/pom.xml index d249d0f375..d580ac759f 100644 --- a/features/features-netconf-experimental/pom.xml +++ b/features/features-netconf-experimental/pom.xml @@ -14,7 +14,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.0.7 + 13.0.10 diff --git a/features/features-netconf-testing/pom.xml b/features/features-netconf-testing/pom.xml index 9a5ac173e8..a0bb69ff60 100644 --- a/features/features-netconf-testing/pom.xml +++ b/features/features-netconf-testing/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.0.7 + 13.0.10 diff --git a/features/features-netconf/pom.xml b/features/features-netconf/pom.xml index 18652a7bc5..dcde600c44 100644 --- a/features/features-netconf/pom.xml +++ b/features/features-netconf/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.0.7 + 13.0.10 diff --git a/features/parent/pom.xml b/features/parent/pom.xml index bb03936274..fa7ac1be16 100644 --- a/features/parent/pom.xml +++ b/features/parent/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features/pom.xml b/features/pom.xml index 8d04b316a7..8780412280 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/karaf-static/pom.xml b/karaf-static/pom.xml index f67c8a4e57..f9c25dd5c5 100644 --- a/karaf-static/pom.xml +++ b/karaf-static/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent karaf-dist-static - 13.0.7 + 13.0.10 diff --git a/karaf/pom.xml b/karaf/pom.xml index 24527eac95..d7c6c8a71b 100644 --- a/karaf/pom.xml +++ b/karaf/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent karaf4-parent - 13.0.7 + 13.0.10 org.opendaylight.netconf @@ -24,14 +24,14 @@ org.opendaylight.infrautils infrautils-artifacts - 6.0.4 + 6.0.5 pom import org.opendaylight.controller controller-artifacts - 8.0.3 + 8.0.4 pom import diff --git a/keystore/pom.xml b/keystore/pom.xml index cc68dfa53b..71212f7bb1 100644 --- a/keystore/pom.xml +++ b/keystore/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/model/pom.xml b/model/pom.xml index e8e5ce0b24..cdcce0af6e 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/netconf/pom.xml b/netconf/pom.xml index 79f86aa86f..7dd3f5b2be 100644 --- a/netconf/pom.xml +++ b/netconf/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/AbstractExecutionStrategy.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/AbstractExecutionStrategy.java index 35d771f2f2..7b6a778d14 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/AbstractExecutionStrategy.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/AbstractExecutionStrategy.java @@ -23,29 +23,29 @@ abstract class AbstractExecutionStrategy implements ExecutionStrategy { final NetconfDeviceCommunicator sessionListener) { editAmount = editConfigMsgs.size(); this.params = params; - this.preparedMessages = editConfigMsgs; + preparedMessages = editConfigMsgs; this.sessionListener = sessionListener; - this.editBatches = countEditBatchSizes(params, editConfigMsgs.size()); + editBatches = countEditBatchSizes(params.editBatchSize, editAmount); } - private static List countEditBatchSizes(final Parameters params, final int amount) { - final List editBatches = new ArrayList<>(); - if (params.editBatchSize != amount) { - final int fullBatches = amount / params.editBatchSize; + private static List countEditBatchSizes(final int editBatchSize, final int amount) { + final var editBatches = new ArrayList(); + if (editBatchSize != amount) { + final int fullBatches = amount / editBatchSize; for (int i = 0; i < fullBatches; i++) { - editBatches.add(params.editBatchSize); + editBatches.add(editBatchSize); } - if (amount % params.editBatchSize != 0) { - editBatches.add(amount % params.editBatchSize); + final var remainder = amount % editBatchSize; + if (remainder != 0) { + editBatches.add(remainder); } } else { - editBatches.add(params.editBatchSize); + editBatches.add(editBatchSize); } return editBatches; } - protected Parameters getParams() { return params; } diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/Parameters.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/Parameters.java index d807da5412..45a049da25 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/Parameters.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/Parameters.java @@ -5,10 +5,10 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.netconf.test.tool.client.stress; import com.google.common.base.Preconditions; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.File; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -32,6 +32,7 @@ public class Parameters { public File editContent; @Arg(dest = "edit-batch-size") + @SuppressFBWarnings("PA_PUBLIC_PRIMITIVE_ATTRIBUTE") public int editBatchSize; @Arg(dest = "candidate-datastore") diff --git a/netconf/tools/pom.xml b/netconf/tools/pom.xml index 67c9ca72d1..123e8cdb3d 100644 --- a/netconf/tools/pom.xml +++ b/netconf/tools/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/parent/pom.xml b/parent/pom.xml index 89f5b2ca87..c6ef1dfc1b 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.mdsal binding-parent - 12.0.3 + 12.0.4 @@ -25,21 +25,21 @@ org.opendaylight.infrautils infrautils-artifacts - 6.0.4 + 6.0.5 pom import org.opendaylight.aaa aaa-artifacts - 0.18.3 + 0.18.4 pom import org.opendaylight.controller bundle-parent - 8.0.3 + 8.0.4 pom import diff --git a/plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/NetconfDeviceCommunicator.java b/plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/NetconfDeviceCommunicator.java index 3c90e6d788..a356f0f7a6 100644 --- a/plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/NetconfDeviceCommunicator.java +++ b/plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/NetconfDeviceCommunicator.java @@ -13,6 +13,7 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.EOFException; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; @@ -87,6 +88,7 @@ public class NetconfDeviceCommunicator implements NetconfClientSessionListener, // // This field is manipulated using CLOSING VarHandle @SuppressWarnings("unused") + @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749") private volatile boolean closing; public boolean isSessionClosing() { diff --git a/plugins/pom.xml b/plugins/pom.xml index 25e84d6237..4196dddad6 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/pom.xml b/pom.xml index f36d8d4096..34bfa715ca 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultCloseSession.java b/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultCloseSession.java index 421122f32d..70c2aaf638 100644 --- a/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultCloseSession.java +++ b/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultCloseSession.java @@ -30,7 +30,7 @@ public class DefaultCloseSession extends AbstractSingletonNetconfOperation imple public static final String CLOSE_SESSION = "close-session"; private final AutoCloseable sessionResources; - private NetconfServerSession session; + private NetconfServerSession session = null; public DefaultCloseSession(final SessionIdType sessionId, final AutoCloseable sessionResources) { super(sessionId); diff --git a/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultStartExi.java b/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultStartExi.java index 1873ae3aa0..64a9c6b57a 100644 --- a/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultStartExi.java +++ b/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultStartExi.java @@ -29,7 +29,8 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement public static final String START_EXI = "start-exi"; private static final Logger LOG = LoggerFactory.getLogger(DefaultStartExi.class); - private NetconfServerSession netconfSession; + + private NetconfServerSession netconfSession = null; public DefaultStartExi(final SessionIdType sessionId) { super(sessionId); diff --git a/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultStopExi.java b/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultStopExi.java index ed23a75204..75ef23f59f 100644 --- a/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultStopExi.java +++ b/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/mapping/operations/DefaultStopExi.java @@ -23,7 +23,8 @@ public class DefaultStopExi extends AbstractSingletonNetconfOperation implements private static final Logger LOG = LoggerFactory.getLogger(DefaultStopExi.class); public static final String STOP_EXI = "stop-exi"; - private NetconfServerSession netconfSession; + + private NetconfServerSession netconfSession = null; public DefaultStopExi(final SessionIdType sessionId) { super(sessionId); diff --git a/protocol/pom.xml b/protocol/pom.xml index b59abba9ec..48eb815a3e 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/restconf/pom.xml b/restconf/pom.xml index d3c023d07f..2a27f8e8ee 100644 --- a/restconf/pom.xml +++ b/restconf/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/databind/AbstractBody.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/databind/AbstractBody.java index 2301c2b2f4..8731c1c774 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/databind/AbstractBody.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/databind/AbstractBody.java @@ -9,6 +9,7 @@ package org.opendaylight.restconf.nb.rfc8040.databind; import static java.util.Objects.requireNonNull; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.IOException; import java.io.InputStream; import java.lang.invoke.MethodHandles; @@ -40,6 +41,7 @@ public abstract sealed class AbstractBody implements AutoCloseable } @SuppressWarnings("unused") + @SuppressFBWarnings(value = "URF_UNREAD_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749") private volatile InputStream inputStream; AbstractBody(final InputStream inputStream) { diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/databind/JsonResourceBody.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/databind/JsonResourceBody.java index 7146ea5827..de30d31ac9 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/databind/JsonResourceBody.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/databind/JsonResourceBody.java @@ -7,20 +7,30 @@ */ package org.opendaylight.restconf.nb.rfc8040.databind; +import com.google.gson.JsonIOException; +import com.google.gson.JsonParseException; import com.google.gson.stream.JsonReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.restconf.common.errors.RestconfDocumentedException; import org.opendaylight.restconf.server.api.DataPutPath; +import org.opendaylight.yangtools.yang.common.ErrorTag; +import org.opendaylight.yangtools.yang.common.ErrorType; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A JSON-encoded {@link ResourceBody}. */ public final class JsonResourceBody extends ResourceBody { + private static final Logger LOG = LoggerFactory.getLogger(JsonResourceBody.class); + public JsonResourceBody(final InputStream inputStream) { super(inputStream); } @@ -31,10 +41,20 @@ public final class JsonResourceBody extends ResourceBody { try (var jsonParser = newParser(path, writer)) { try (var reader = new JsonReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { jsonParser.parse(reader); + } catch (JsonParseException e) { + LOG.debug("Error parsing JSON input", e); + throw newRDE(e); } } } + private static @NonNull RestconfDocumentedException newRDE(final JsonParseException cause) { + final var root = cause instanceof JsonIOException jsonIO && jsonIO.getCause() instanceof IOException io ? io + : cause; + return new RestconfDocumentedException("Error parsing input: " + root.getMessage(), ErrorType.PROTOCOL, + ErrorTag.MALFORMED_MESSAGE, cause); + } + private static JsonParserStream newParser(final DataPutPath path, final NormalizedNodeStreamWriter writer) { final var codecs = path.databind().jsonCodecs(); final var inference = path.inference(); diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/api/DatabindContext.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/api/DatabindContext.java index 1959d53bb8..befe466df6 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/api/DatabindContext.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/api/DatabindContext.java @@ -9,6 +9,7 @@ package org.opendaylight.restconf.server.api; import static java.util.Objects.requireNonNull; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import org.eclipse.jdt.annotation.NonNull; @@ -41,10 +42,13 @@ public final class DatabindContext { private final @NonNull MountPointContext mountContext; @SuppressWarnings("unused") + @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749") private volatile DataSchemaContextTree schemaTree; @SuppressWarnings("unused") + @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749") private volatile JSONCodecFactory jsonCodecs; @SuppressWarnings("unused") + @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749") private volatile XmlCodecFactory xmlCodecs; private DatabindContext(final @NonNull MountPointContext mountContext) { diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/mdsal/MdsalRestconfServer.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/mdsal/MdsalRestconfServer.java index 4a14e6b136..edfe86e53d 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/mdsal/MdsalRestconfServer.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/mdsal/MdsalRestconfServer.java @@ -12,6 +12,7 @@ import static java.util.Objects.requireNonNull; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.net.URI; @@ -110,6 +111,7 @@ public final class MdsalRestconfServer private final Registration reg; @SuppressWarnings("unused") + @SuppressFBWarnings(value = "URF_UNREAD_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749") private volatile MdsalRestconfStrategy localStrategy; @Inject diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/spi/RestconfStream.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/spi/RestconfStream.java index 18495a58c5..a746a98a1b 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/spi/RestconfStream.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/spi/RestconfStream.java @@ -12,6 +12,7 @@ import static java.util.Objects.requireNonNull; import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects.ToStringHelper; import com.google.common.collect.ImmutableMap; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.UnsupportedEncodingException; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; @@ -192,6 +193,7 @@ public final class RestconfStream { // Accessed via SUBSCRIBERS, 'null' indicates we have been shut down @SuppressWarnings("unused") + @SuppressFBWarnings(value = "URF_UNREAD_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749") private volatile Subscribers subscribers = Subscribers.empty(); @GuardedBy("this") diff --git a/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/databind/JsonResourceBodyTest.java b/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/databind/JsonResourceBodyTest.java index f1c3dcb122..5efba38bb4 100644 --- a/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/databind/JsonResourceBodyTest.java +++ b/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/databind/JsonResourceBodyTest.java @@ -8,8 +8,6 @@ package org.opendaylight.restconf.nb.rfc8040.databind; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertThrows; import java.util.Map; import org.junit.jupiter.api.Test; @@ -109,14 +107,17 @@ class JsonResourceBodyTest extends AbstractResourceBodyTest { @Test void testMissingKeys() { - final var ex = assertThrows(IllegalArgumentException.class, - () -> parse("nested-module:depth1-cont/depth2-list2=one,two", """ + final var error = assertError(() -> parse("nested-module:depth1-cont/depth2-list2=one,two", """ { "depth2-list2" : { "depth3-lf1-key" : "one" } }""")); - assertNull(ex.getMessage()); + assertEquals(""" + Error parsing input: List entry (urn:nested:module?revision=2014-06-03)depth2-list2 is missing leaf values \ + for [depth3-lf2-key]""", error.getErrorMessage()); + assertEquals(ErrorType.PROTOCOL, error.getErrorType()); + assertEquals(ErrorTag.MALFORMED_MESSAGE, error.getErrorTag()); } @Test diff --git a/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/databind/XmlResourceBodyTest.java b/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/databind/XmlResourceBodyTest.java index 50db4a3db3..90645614cf 100644 --- a/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/databind/XmlResourceBodyTest.java +++ b/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/databind/XmlResourceBodyTest.java @@ -8,7 +8,6 @@ package org.opendaylight.restconf.nb.rfc8040.databind; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doReturn; @@ -208,11 +207,14 @@ class XmlResourceBodyTest extends AbstractResourceBodyTest { @Test void testMissingKeys() throws Exception { - final var ex = assertThrows(IllegalArgumentException.class, - () -> parse("nested-module:depth1-cont/depth2-list2=one,two", """ + final var error = assertError(() -> parse("nested-module:depth1-cont/depth2-list2=one,two", """ one """)); - assertNull(ex.getMessage()); + assertEquals(""" + Error parsing input: List entry (urn:nested:module?revision=2014-06-03)depth2-list2 is missing leaf values \ + for [depth3-lf2-key]""", error.getErrorMessage()); + assertEquals(ErrorType.PROTOCOL, error.getErrorType()); + assertEquals(ErrorTag.MALFORMED_MESSAGE, error.getErrorTag()); } } diff --git a/restconf/sal-rest-connector-config/pom.xml b/restconf/sal-rest-connector-config/pom.xml index 9f9a34eeb0..c5d5f43a60 100644 --- a/restconf/sal-rest-connector-config/pom.xml +++ b/restconf/sal-rest-connector-config/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/restconf/websocket-client/pom.xml b/restconf/websocket-client/pom.xml index 05efd985a9..e2f6611962 100644 --- a/restconf/websocket-client/pom.xml +++ b/restconf/websocket-client/pom.xml @@ -29,7 +29,6 @@ net.sourceforge.argparse4j argparse4j - 0.9.0 org.opendaylight.controller diff --git a/restconf/websocket-client/src/main/java/org/opendaylight/restconf/websocket/client/WebSocketSessionHandler.java b/restconf/websocket-client/src/main/java/org/opendaylight/restconf/websocket/client/WebSocketSessionHandler.java index 6c5e2536a4..520a522c1a 100644 --- a/restconf/websocket-client/src/main/java/org/opendaylight/restconf/websocket/client/WebSocketSessionHandler.java +++ b/restconf/websocket-client/src/main/java/org/opendaylight/restconf/websocket/client/WebSocketSessionHandler.java @@ -30,11 +30,10 @@ import org.slf4j.LoggerFactory; */ @WebSocket public class WebSocketSessionHandler { - private static final Logger LOG = LoggerFactory.getLogger(WebSocketSessionHandler.class); private final CountDownLatch sessionCloseLatch = new CountDownLatch(1); - Session webSocketSession; + Session webSocketSession = null; /** * Handling of the initialized web-socket session. Created web-socket session is saved. diff --git a/third-party/pom.xml b/third-party/pom.xml index 2150d7a04f..9770001bce 100644 --- a/third-party/pom.xml +++ b/third-party/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/third-party/shaded-exificient-jar/pom.xml b/third-party/shaded-exificient-jar/pom.xml index 0e53cddf08..0859809048 100644 --- a/third-party/shaded-exificient-jar/pom.xml +++ b/third-party/shaded-exificient-jar/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent odlparent - 13.0.7 + 13.0.10 diff --git a/third-party/shaded-exificient/pom.xml b/third-party/shaded-exificient/pom.xml index 7035e8e1d6..3587c28261 100644 --- a/third-party/shaded-exificient/pom.xml +++ b/third-party/shaded-exificient/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent bundle-parent - 13.0.7 + 13.0.10 diff --git a/third-party/shaded-sshd-jar/pom.xml b/third-party/shaded-sshd-jar/pom.xml index acdd8d080f..261979e101 100644 --- a/third-party/shaded-sshd-jar/pom.xml +++ b/third-party/shaded-sshd-jar/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent - 13.0.7 + 13.0.10 diff --git a/third-party/shaded-sshd/pom.xml b/third-party/shaded-sshd/pom.xml index 54a97c7258..58c591d4ec 100644 --- a/third-party/shaded-sshd/pom.xml +++ b/third-party/shaded-sshd/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent bundle-parent - 13.0.7 + 13.0.10 diff --git a/transport/pom.xml b/transport/pom.xml index 53408fb7b6..e157af85db 100644 --- a/transport/pom.xml +++ b/transport/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/transport/transport-ssh/src/main/java/org/opendaylight/netconf/transport/ssh/TransportServerSession.java b/transport/transport-ssh/src/main/java/org/opendaylight/netconf/transport/ssh/TransportServerSession.java index 1ea4287e49..90b358d152 100644 --- a/transport/transport-ssh/src/main/java/org/opendaylight/netconf/transport/ssh/TransportServerSession.java +++ b/transport/transport-ssh/src/main/java/org/opendaylight/netconf/transport/ssh/TransportServerSession.java @@ -11,6 +11,7 @@ import static java.util.Objects.requireNonNull; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.netty.channel.ChannelHandlerContext; import java.io.IOException; import java.lang.invoke.MethodHandles; @@ -43,6 +44,7 @@ final class TransportServerSession extends ServerSessionImpl { } @SuppressWarnings("unused") + @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749") private volatile State state; TransportServerSession(final TransportSshServer server, final IoSession ioSession) throws Exception { diff --git a/truststore/pom.xml b/truststore/pom.xml index 7e24118a8c..251f7c8db0 100644 --- a/truststore/pom.xml +++ b/truststore/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 -- 2.36.6