summaryrefslogtreecommitdiffstats
path: root/misc/rosetta
diff options
context:
space:
mode:
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;