Skip to content

Commit

Permalink
fix SourcePositionImpl#addChild(CtElement, CtElement)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvojtechovsky committed Mar 31, 2018
1 parent 1aa7208 commit fd61958
Showing 1 changed file with 9 additions and 5 deletions.
Expand Up @@ -262,12 +262,16 @@ private static void addChild(CtElement parentElement, CtElement childElement) {
childSPI.checkValid();
SourcePositionImpl parentSP = SourcePositionUtils.getMyOrParentsSourcePosition(parentElement);
if (parentSP != null) {
int cmp = parentSP.compare(childSPI);
if (cmp == 0) {
parentSP.addChild(childSPI);
} else {
SourcePosition.class.getClass();
if (parentSP != childSPI) {
int cmp = parentSP.compare(childSPI);
if (cmp == 0) {
parentSP.addChild(childSPI);
} else {
SourcePosition.class.getClass();
}
}
//else these two elements has same instance of SourcePosition.
//It is probably OK
}
return;
}
Expand Down

0 comments on commit fd61958

Please sign in to comment.