Merge "Support more Generic workflow for voLTE"
[so.git] / adapters / mso-catalog-db-adapter / src / main / java / org / openecomp / mso / adapters / catalogdb / catalogrest / QueryVfModules.java
index f687aca..ff71399 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP - SO
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.
@@ -36,10 +37,13 @@ public class QueryVfModules {
        private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
        private List<VfModule> vfModules;
 
-       public QueryVfModules() { super(); vfModules = new ArrayList<VfModule>(); }
+       public QueryVfModules() {
+               super();
+               vfModules = new ArrayList<>();
+       }
        public QueryVfModules(List<VfModule> vlist) { 
                LOGGER.debug ("QueryVfModules:");
-               vfModules = new ArrayList<VfModule>();
+               vfModules = new ArrayList<>();
                for (VfModule o : vlist) {
                        LOGGER.debug ("-- o is a vfModules ----");
                        LOGGER.debug (o.toString());
@@ -54,13 +58,14 @@ public class QueryVfModules {
        
        @Override
        public String toString () {
-               StringBuffer buf = new StringBuffer();
+               StringBuilder buf = new StringBuilder();
 
                boolean first = true;
                int i = 1;
                for (VfModule o : vfModules) {
                        buf.append(i+"\t");
-                       if (!first) buf.append("\n"); first = false;
+                       if (!first) buf.append("\n");
+                       first = false;
                        buf.append(o);
                }
                return buf.toString();
@@ -74,6 +79,7 @@ public class QueryVfModules {
                        LOGGER.debug ("QueryVfModules jsonString: "+jsonString);
                }
                catch (Exception e) {
+                   LOGGER.debug ("Exception:", e);
                        LOGGER.debug ("QueryVfModules jsonString exception:"+e.getMessage()); 
                }
                return jsonString;