Skip to content

Commit 8256ac4

Browse files
committed
generator: fix oddity in MSVExpressionIterator.getNextExpression()
If the current node is ignored due to isNoKnownElement(), the following siblings on the same level were skipped as well - this appears a bit suspicious.
1 parent bcb0a31 commit 8256ac4

File tree

4 files changed

+39418
-38881
lines changed

4 files changed

+39418
-38881
lines changed

generator/schema2template/src/main/java/schema2template/model/MSVExpressionIterator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ private Expression getNextExpression() {
206206
Expression nextExpCandidate = children.get(0);
207207
// DO NOT expand elements which occur more than one time in the ancestors hierarchy (i.e.
208208
// since we compute the last element: Do not expand it, if it also occurs before)
209+
mAncestorsAndCurrent.push(new UniqueAncestor(nextExpCandidate, 0));
209210
if (isNoKnownElement(nextExpCandidate)) {
210211
// GO DOWN - Proceed with first child
211212
nextExpression = nextExpCandidate;
212-
mAncestorsAndCurrent.push(new UniqueAncestor(nextExpression, 0));
213213
}
214214
}
215215
}
@@ -230,10 +230,10 @@ private Expression getNextExpression() {
230230
Expression nextExpCandidate = siblings.get(nextSiblingIndex);
231231
// DO NOT expand elements which occur more than one time in the ancestors hierarchy (i.e.
232232
// since we compute the last element: Do not expand it, if it also occurs before)
233+
mAncestorsAndCurrent.push(new UniqueAncestor(nextExpCandidate, nextSiblingIndex));
233234
if (isNoKnownElement(nextExpCandidate)) {
234235
// GO RIGHT - Add next sibling to the stack
235236
nextExpression = nextExpCandidate;
236-
mAncestorsAndCurrent.push(new UniqueAncestor(nextExpression, nextSiblingIndex));
237237
}
238238
}
239239
}

0 commit comments

Comments
 (0)