From 432fef94a0e2960a2422d335631dafa727e2cfc3 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Fri, 23 Feb 2018 09:25:46 -0500 Subject: [PATCH] Fix checkstyle violations in restconf-common Change-Id: Ib57f7ba64c0804e2c3cdd81c264c0b2a80f24d5f Signed-off-by: Tom Pantelis --- .../restconf/common/context/WriterParameters.java | 2 +- .../common/errors/RestconfDocumentedException.java | 1 - .../restconf/common/errors/RestconfError.java | 10 +++++----- .../opendaylight/restconf/common/util/RestUtil.java | 3 +++ .../common/validation/RestconfValidationUtils.java | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/context/WriterParameters.java b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/context/WriterParameters.java index 4f82f24b32..8941f9751c 100644 --- a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/context/WriterParameters.java +++ b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/context/WriterParameters.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; -public class WriterParameters { +public final class WriterParameters { private final String content; private final Integer depth; private final List> fields; diff --git a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfDocumentedException.java b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfDocumentedException.java index dd93c534ba..130d8bef79 100644 --- a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfDocumentedException.java +++ b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfDocumentedException.java @@ -9,7 +9,6 @@ package org.opendaylight.restconf.common.errors; import com.google.common.base.Preconditions; -import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.util.Collection; diff --git a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfError.java b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfError.java index 0ed06e840a..5e369dd894 100644 --- a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfError.java +++ b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfError.java @@ -220,18 +220,18 @@ public class RestconfError { this.errorMessage = rpcError.getMessage(); this.errorAppTag = rpcError.getApplicationTag(); - String errorInfo = null; + String localErrorInfo = null; if (rpcError.getInfo() == null) { if (rpcError.getCause() != null) { - errorInfo = Throwables.getStackTraceAsString(rpcError.getCause()); + localErrorInfo = Throwables.getStackTraceAsString(rpcError.getCause()); } else if (rpcError.getSeverity() != null) { - errorInfo = "" + rpcError.getSeverity().toString().toLowerCase() + ""; + localErrorInfo = "" + rpcError.getSeverity().toString().toLowerCase() + ""; } } else { - errorInfo = rpcError.getInfo(); + localErrorInfo = rpcError.getInfo(); } - this.errorInfo = errorInfo; + this.errorInfo = localErrorInfo; this.errorPath = null; } diff --git a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/util/RestUtil.java b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/util/RestUtil.java index ff04373f2c..82551250ac 100644 --- a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/util/RestUtil.java +++ b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/util/RestUtil.java @@ -29,6 +29,9 @@ public final class RestUtil { public static final String DQUOTE = "\""; private static final Pattern PREDICATE_PATTERN = Pattern.compile("\\[(.*?)\\]"); + private RestUtil() { + } + public static TypeDefinition resolveBaseTypeFrom(final TypeDefinition type) { TypeDefinition superType = type; while (superType.getBaseType() != null) { diff --git a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/validation/RestconfValidationUtils.java b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/validation/RestconfValidationUtils.java index cdd30aaee2..117b7041dd 100644 --- a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/validation/RestconfValidationUtils.java +++ b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/validation/RestconfValidationUtils.java @@ -22,7 +22,7 @@ import org.opendaylight.restconf.common.errors.RestconfError.ErrorType; * for all error situation followed by restconf-netconf specification. * See also RESTCONF. */ -public class RestconfValidationUtils { +public final class RestconfValidationUtils { private RestconfValidationUtils() { throw new UnsupportedOperationException("Utility class"); -- 2.36.6