diff options
author | Jim Hahn <jrh3@att.com> | 2021-05-06 11:28:53 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-05-06 15:26:24 -0400 |
commit | 1d0aaaa5b31719c1718700bb0d1a99c413fd513c (patch) | |
tree | bd2687f1d38f3e3c4e53a68695c8c91c6866468e /common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterException.java | |
parent | 3b00f1c32b89282dcbb74d3d3645e263f005319e (diff) |
Fix sonars in policy-common
Fixed sonars:
- use "var" instead of actual type name
- re-interrupt threads
- use rej2 split() instead of String split()
Issue-ID: POLICY-3285
Change-Id: I82261e0b8a53ee5c5264556fbf5cec37454f014e
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterException.java')
-rw-r--r-- | common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterException.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterException.java b/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterException.java index 0b29a4e6..84faa9c8 100644 --- a/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterException.java +++ b/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterException.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,15 +85,15 @@ public class ParameterException extends Exception { /** * Build a cascaded message from an exception and all its nested exceptions. - * + * * @param throwable the top level exception * @return cascaded message string */ public static String buildCascadedMessage(final Throwable throwable) { - final StringBuilder builder = new StringBuilder(); + final var builder = new StringBuilder(); builder.append(throwable.getMessage()); - for (Throwable t = throwable; t != null; t = t.getCause()) { + for (var t = throwable; t != null; t = t.getCause()) { builder.append("\ncaused by: "); builder.append(t.getMessage()); } |