Consider missing attributes as blank 95/9395/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Wed, 30 Aug 2017 11:50:36 +0000 (17:20 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Wed, 30 Aug 2017 11:53:44 +0000 (17:23 +0530)
sometime the response does not have the required
filed to process and consider it as blank instead of
failing it

CLI-37
Change-Id: I953fcd5ee92aac5ca926029462f15f45ba765dfc
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java
plugins/aai/src/test/resources/onap-cli-sample/cloud-region/cloud-list-sample-1.1.yaml [moved from plugins/aai/src/test/resources/onap-cli-sample/cloud-region/cloud-list-sample.yaml with 100% similarity]

index 48a4e6e..8b7a9b8 100644 (file)
@@ -123,7 +123,7 @@ public class OnapCommandPrint {
         for (int i = 0; i < this.findMaxRows(); i++) {
             List<Object> row = new ArrayList<>();
             for (List<String> cols : this.data.values()) {
-                if (cols.size() > i) {
+                if (cols != null && cols.size() > i) {
                     String value = cols.get(i);
                     // split the cell into multiple sub rows
                     if (isNormalize && value != null && value.length() > MAX_COLUMN_LENGTH) {
@@ -133,7 +133,7 @@ public class OnapCommandPrint {
                         row.add(value);
                     }
                 } else {
-                    // now value exist for this column
+                    // no value exist for this column
                     row.add(null);
                 }
             }