From: Arundathi Patil Date: Tue, 1 Jan 2019 07:14:46 +0000 (+0530) Subject: Sonar fix: LeafNode.java X-Git-Tag: 0.4.0~6^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=970e528c4996b4994d3e40d1c3a2296af4760563;p=ccsdk%2Fsli%2Fplugins.git Sonar fix: LeafNode.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-886 Change-Id: I7a5b73549b98571e207e0ed70e49873785478e70 Signed-off-by: Arundathi Patil --- diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/LeafNode.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/LeafNode.java index c9cf95ba..041175ca 100644 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/LeafNode.java +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/LeafNode.java @@ -3,6 +3,8 @@ * ONAP - CCSDK * ================================================================================ * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. + * + * Modifications Copyright © 2018 IBM * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +31,7 @@ public class LeafNode extends PropertiesNode implements LeafListHolderChild, Dat private String value; private Namespace valueNs; + private static final String svcLogicException = "Leaf cannot hold child nodes"; /** * Creates an instance of leaf node. @@ -89,7 +92,7 @@ public class LeafNode extends PropertiesNode implements LeafListHolderChild, Dat public PropertiesNode addChild(String name, Namespace namespace, NodeType type, Object appInfo) throws SvcLogicException { - throw new SvcLogicException("Leaf cannot hold child nodes"); + throw new SvcLogicException(svcLogicException); } @Override @@ -97,7 +100,7 @@ public class LeafNode extends PropertiesNode implements LeafListHolderChild, Dat NodeType type, String value, Namespace valueNs, Object appInfo) throws SvcLogicException { - throw new SvcLogicException("Leaf cannot hold child nodes"); + throw new SvcLogicException(svcLogicException); } @Override @@ -105,7 +108,7 @@ public class LeafNode extends PropertiesNode implements LeafListHolderChild, Dat Namespace namespace, NodeType type, Object appInfo) throws SvcLogicException { - throw new SvcLogicException("Leaf cannot hold child nodes"); + throw new SvcLogicException(svcLogicException); } @Override