TCGOCLExpression in_oCheckedExpression,
TCGOCLExpression in_oWarrantedExpression) {
// compare atoms
if(in_oCheckedExpression instanceof TCGOCLAtom &&
in_oWarrantedExpression instanceof TCGOCLAtom) {
TCGOCLAtom oCheckedAtom = (TCGOCLAtom)in_oCheckedExpression;
TCGOCLAtom oWarrantedAtom = (TCGOCLAtom)in_oWarrantedExpression;
return oCheckedAtom.getElement().equals(oWarrantedAtom.getElement());
}
// compare operations
else if(in_oCheckedExpression instanceof TCGOCLOperation &&
in_oWarrantedExpression instanceof TCGOCLOperation) {
OCLTreeTCGOCLAtomCollectorVisitor oFirstCollector =
new OCLTreeTCGOCLAtomCollectorVisitor();
OCLTreeTCGOCLAtomCollectorVisitor oSecondCollector =
new OCLTreeTCGOCLAtomCollectorVisitor();
OCLTreeExpressionIterator.run(in_oCheckedExpression, oFirstCollector);
OCLTreeExpressionIterator.run(in_oWarrantedExpression, oSecondCollector);
// try to adapt both sides to each other
TCGOCLAtom oFirstAtom = oFirstCollector.getExpressions().get(0);
TCGOCLAtom oSecondAtom = null;
for(TCGOCLAtom oTmpAtom : oSecondCollector.getExpressions()) {
if(expressionsContainReferenceToTheSameObject(
oFirstAtom, oTmpAtom)) {
// if(oFirstAtom.getElement().equals(oTmpAtom.getElement())) {
oSecondAtom = oTmpAtom;