X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=ONAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Frest%2Futil%2FMSModelUtils.java;h=18fd80c63595f6b2a0f1dfd0b9453721f099cf59;hb=b7594ee217d0fd4c724fd64dd48d2e154fdd6e90;hp=e96396e0c403ead214db91955fe6943cd35abb78;hpb=6a44b2926f33b427904c2f3e7962d0dfc360c482;p=policy%2Fengine.git diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java index e96396e0c..18fd80c63 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java @@ -2,7 +2,7 @@ * ============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. @@ -102,7 +102,7 @@ public class MSModelUtils { // 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(); @@ -184,9 +184,7 @@ public class MSModelUtils { 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 getEEnum(EObject obj) { @@ -352,10 +350,7 @@ public class MSModelUtils { public JSONObject buildJavaObject(Map map){ - JSONObject returnValue = new JSONObject(map); - - return returnValue; - + return new JSONObject(map); } public Map getRefAttributeList(EPackage root, String className, String superClass){ @@ -651,9 +646,7 @@ public class MSModelUtils { } Gson gson = new Gson(); - String json = gson.toJson(myObject); - - return json; + return gson.toJson(myObject); } public Map getRefclass(Map classMap, String className){ @@ -687,8 +680,7 @@ public class MSModelUtils { } } - String returnValue = createJson(workingMap, classMap, modelName); - return returnValue; + return createJson(workingMap, classMap, modelName); } public List getFullDependencyList(List dependency, Map classMap) {