Minor Sonar issues are fixed in the ONAP_REST module.
The copyright headers of the changed files are also updated.
Issue-ID: POLICY-476
Change-Id: I920d8bcdd7b855e3e1660a002fb0e4e8d1674e44
Signed-off-by: Ankitkumar Patel <ankit@research.att.com>
* ============LICENSE_START=======================================================
* ONAP-REST
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 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.
public void setAttribute(Attribute attribute) {
this.attribute = attribute;
}
-
+
+ @Override
public ConstraintValue clone() {
ConstraintValue constraint = new ConstraintValue();
* ============LICENSE_START=======================================================
* ONAP-REST
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 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.
}
@Transient
+ @Override
public Obadvice clone() {
Obadvice obadvice = new Obadvice();
* ============LICENSE_START=======================================================
* ONAP-REST
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 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.
this.obadvice = obadvice;
}
+ @Override
public ObadviceExpression clone() {
ObadviceExpression expression = new ObadviceExpression();
* ============LICENSE_START=======================================================
* ONAP-REST
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 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.
@Transient
public void clearConfigParams() {
- while (this.pipconfigParams.isEmpty() == false) {
+ while (!this.pipconfigParams.isEmpty()) {
this.removePipconfigParam(this.pipconfigParams.iterator().next());
}
}
// Go through each property
//
for (Object nme : properties.keySet()) {
- if (nme.toString().startsWith(id) == false) {
+ if (!nme.toString().startsWith(id)) {
continue;
}
if (nme.equals(id + ".classname")) {
} else {
prefix = name;
}
- if (prefix.endsWith(".") == false) {
+ if (!prefix.endsWith(".")) {
prefix = prefix + ".";
}
Map<String, String> map = new HashMap<>();
if (this.description != null) {
props.setProperty(prefix + "description", this.description);
}
- if (this.issuer != null && this.issuer.isEmpty() == false) {
+ if (this.issuer != null && !this.issuer.isEmpty()) {
props.setProperty(prefix + "issuer", this.issuer);
}
* ============LICENSE_START=======================================================
* ONAP-REST
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 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.
@Transient
public void clearParams() {
- while (this.pipresolverParams.isEmpty() == false) {
+ while (!this.pipresolverParams.isEmpty()) {
this.removePipresolverParam(this.pipresolverParams.iterator().next());
}
}
// Go through each property
//
for (Object nme : properties.keySet()) {
- if (nme.toString().startsWith(prefix) == false) {
+ if (!nme.toString().startsWith(prefix)) {
continue;
}
if (nme.equals(prefix + ".classname")) {
public Map<String, String> getConfiguration(String prefix) {
String pref = prefix;
Map<String, String> map = new HashMap<>();
- if (prefix.endsWith(".") == false) {
+ if (!prefix.endsWith(".")) {
pref = prefix + ".";
}
map.put(pref + "classname", this.classname);
if (this.description != null) {
map.put(pref + "description", this.description);
}
- if (this.issuer != null && this.issuer.isEmpty() != false) {
+ if (this.issuer != null && this.issuer.isEmpty()) {
map.put(pref + "issuer", this.issuer);
}
for (PIPResolverParam param : this.pipresolverParams) {
@Transient
public void generateProperties(Properties props, String prefix) {
String pref = prefix;
- if (prefix.endsWith(".") == false) {
+ if (!prefix.endsWith(".")) {
pref = prefix + ".";
}
props.setProperty(pref + "classname", this.classname);
if (this.description != null) {
props.setProperty(pref + "description", this.description);
}
- if (this.issuer != null && this.issuer.isEmpty() != false) {
+ if (this.issuer != null && this.issuer.isEmpty()) {
props.setProperty(pref + "issuer", this.issuer);
}
for (PIPResolverParam param : this.pipresolverParams) {
* ============LICENSE_START=======================================================
* ONAP-REST
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 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.
// Pulling out dependency from file
while (treeItr.hasNext()) {
- EObject obj = (EObject) treeItr.next();
+ EObject obj = treeItr.next();
if (obj instanceof EClassifier) {
EClassifier eClassifier = (EClassifier) obj;
className = eClassifier.getName();
logger.error("Error loading Encore Resource for new Model" + e);
}
- EPackage root = (EPackage) resource.getContents().get(0);
-
- return root;
+ return (EPackage) resource.getContents().get(0);
}
private HashMap<String, String> getEEnum(EObject obj) {
public JSONObject buildJavaObject(Map<String, String> map){
- JSONObject returnValue = new JSONObject(map);
-
- return returnValue;
-
+ return new JSONObject(map);
}
public Map<String, String> getRefAttributeList(EPackage root, String className, String superClass){
}
Gson gson = new Gson();
- String json = gson.toJson(myObject);
-
- return json;
+ return gson.toJson(myObject);
}
public Map<String, String> getRefclass(Map<String, MSAttributeObject> classMap, String className){
}
}
- String returnValue = createJson(workingMap, classMap, modelName);
- return returnValue;
+ return createJson(workingMap, classMap, modelName);
}
public List<String> getFullDependencyList(List<String> dependency, Map<String,MSAttributeObject > classMap) {
* ============LICENSE_START=======================================================
* ONAP Policy Engine
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 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.
valid = false;
}
} else if ("PROPERTIES".equals(configType)) {
- if (!PolicyUtils.isPropValid(configBodyData)||configBodyData.equals("")) {
+ if (!PolicyUtils.isPropValid(configBodyData) || "".equals(configBodyData)) {
responseString.append("Config Body: Property data is not valid" + HTML_ITALICS_LNBREAK);
valid = false;
}
* ============LICENSE_START=======================================================
* ONAP Policy Engine
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 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.
ArrayList<Object> attributeList = new ArrayList<>();
if (matching != null) {
- for (String keyField : matching.keySet()) {
+ for (Map.Entry<String, String> entry : matching.entrySet()) {
LinkedHashMap<String, String> attributeMap = new LinkedHashMap<>();
- String key = keyField;
- String value = matching.get(keyField);
+ String key = entry.getKey();
+ String value = entry.getValue();
attributeMap.put("key", key);
attributeMap.put("value", value);
attributeList.add(attributeMap);