summaryrefslogtreecommitdiffstats
path: root/misc/rosetta
diff options
context:
space:
mode:
authorIanHowell <ian.howell@att.com>2018-05-01 10:48:55 -0500
committerIanHowell <ian.howell@att.com>2018-05-01 10:49:03 -0500
commit0af1db4fda4667244af0cec983293aefa203d710 (patch)
treea04d26ef77e7643708646c16e6e2facd2a6e3f77 /misc/rosetta
parentc662d585d8f830eb214408c01749516d447c76c8 (diff)
Improve coverage of cadi-aaf
Issue-ID: AAF-223 Change-Id: I2a7835720341989b45de239157dd1c4f976b1e6a Signed-off-by: IanHowell <ian.howell@att.com>
Diffstat (limited to 'misc/rosetta')
-rw-r--r--misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/marshal/ObjArray.java35
-rw-r--r--misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/marshal/ObjMarshal.java35
2 files changed, 34 insertions, 36 deletions
diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/marshal/ObjArray.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/marshal/ObjArray.java
index 3d7d1b4e..fa95dee5 100644
--- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/marshal/ObjArray.java
+++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/marshal/ObjArray.java
@@ -53,25 +53,24 @@ public abstract class ObjArray<T,S> extends Marshal<T> {
parsed.event = START_ARRAY;
parsed.name = name;
}
- } else if (DONE_ITERATOR.equals(iter)) {
- } else {
+ } else if (!DONE_ITERATOR.equals(iter)) {
ladder.ascend(); // look at field info
- Iterator<?> memIter = ladder.peek();
- ListIterator<S> mems = (ListIterator<S>)iter;
- S mem;
- if(memIter==null) {
- mem=mems.next();
- } else if(!DONE_ITERATOR.equals(memIter)) {
- mem=mems.peek();
- } else if(iter.hasNext()) {
- mem=null;
- ladder.push(null);
- } else {
- mem=null;
- }
-
- if(mem!=null)
- parsed = subMarshaller.parse(mem, parsed);
+ Iterator<?> memIter = ladder.peek();
+ ListIterator<S> mems = (ListIterator<S>)iter;
+ S mem;
+ if(memIter==null) {
+ mem=mems.next();
+ } else if(!DONE_ITERATOR.equals(memIter)) {
+ mem=mems.peek();
+ } else if(iter.hasNext()) {
+ mem=null;
+ ladder.push(null);
+ } else {
+ mem=null;
+ }
+
+ if(mem!=null)
+ parsed = subMarshaller.parse(mem, parsed);
ladder.descend();
if(mem==null) {
if(iter.hasNext()) {
diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/marshal/ObjMarshal.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/marshal/ObjMarshal.java
index 4857293e..cb2c478a 100644
--- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/marshal/ObjMarshal.java
+++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/marshal/ObjMarshal.java
@@ -73,26 +73,25 @@ public abstract class ObjMarshal<T> extends Marshal<T> {
} else {
ladder.push(DONE_ITERATOR);
}
- } else if (DONE_ITERATOR.equals(iter)) {
- } else {
+ } else if (!DONE_ITERATOR.equals(iter)) {
FieldsIterator fields = (FieldsIterator)iter;
ladder.ascend(); // look at field info
- Iterator<?> currFieldIter = ladder.peek();
- Marshal<T> marshal;
- if(currFieldIter==null) {
- marshal=fields.next();
- } else if(!DONE_ITERATOR.equals(currFieldIter)) {
- marshal=fields.peek();
- if(marshal==null && fields.hasNext())marshal=fields.next();
- } else if(fields.hasNext()) {
- marshal=fields.next();
- ladder.push(null);
- } else {
- marshal=null;
- }
-
- if(marshal!=null)
- parsed = marshal.parse(in, parsed);
+ Iterator<?> currFieldIter = ladder.peek();
+ Marshal<T> marshal;
+ if(currFieldIter==null) {
+ marshal=fields.next();
+ } else if(!DONE_ITERATOR.equals(currFieldIter)) {
+ marshal=fields.peek();
+ if(marshal==null && fields.hasNext())marshal=fields.next();
+ } else if(fields.hasNext()) {
+ marshal=fields.next();
+ ladder.push(null);
+ } else {
+ marshal=null;
+ }
+
+ if(marshal!=null)
+ parsed = marshal.parse(in, parsed);
ladder.descend();
if(marshal==null || parsed.event==NONE) {
parsed.event = END_OBJ;