right_cls2Status.clear();
//traversing left tree
Collection clses1 = kb_left.getClses();
for (Iterator iterator = clses1.iterator(); iterator.hasNext();) {
Cls cls1 = (Cls) iterator.next();
if (cls1.isSystem()) { continue; }
Cls cls2 = kb_right.getCls(cls1.getName());
if (cls2 != null) { //found a match
//test if parents are still the same
if (equalsSetByName(cls1.getDirectSuperclasses(), cls2.getDirectSuperclasses())) {
setStatus(cls1, FrameStatus.UNCHANGED, left_cls2Status);
setStatus(cls2, FrameStatus.UNCHANGED, right_cls2Status);
} else {
setStatus(cls1, FrameStatus.MOVED, left_cls2Status);
setStatus(cls2, FrameStatus.MOVED, right_cls2Status);
setParentsStatus(cls1, FrameStatus.CHILDREN_MOVED, left_cls2Status);
setParentsStatus(cls2, FrameStatus.CHILDREN_MOVED, right_cls2Status);
}
} else {
setStatus(cls1, FrameStatus.DELETED, left_cls2Status);
setParentsStatus(cls1, FrameStatus.CHILDREN_DELETED, left_cls2Status);
}
}
//traversing right tree
Collection clses2 = kb_right.getClses();
for (Iterator iterator = clses2.iterator(); iterator.hasNext();) {
Cls cls2 = (Cls) iterator.next();
if (cls2.isSystem()) { continue ; }
Cls cls1 = kb_left.getCls(cls2.getName());
if (cls1 == null) { //found a match
setStatus(cls2, FrameStatus.ADDED, right_cls2Status);
setParentsStatus(cls2, FrameStatus.CHILDREN_ADDED, right_cls2Status);
}
}