public virtual Differences VisitFaultHandler(FaultHandler faultHandler1, FaultHandler faultHandler2){ Differences differences = new Differences(faultHandler1, faultHandler2); if (faultHandler1 == null || faultHandler2 == null){ if (faultHandler1 != faultHandler2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++; return differences; } FaultHandler changes = (FaultHandler)faultHandler2.Clone(); FaultHandler deletions = (FaultHandler)faultHandler2.Clone(); FaultHandler insertions = (FaultHandler)faultHandler2.Clone(); Differences diff = this.VisitBlock(faultHandler1.Block, faultHandler2.Block); if (diff == null){Debug.Assert(false); return differences;} changes.Block = diff.Changes as Block; deletions.Block = diff.Deletions as Block; insertions.Block = diff.Insertions as Block; Debug.Assert(diff.Changes == changes.Block && diff.Deletions == deletions.Block && diff.Insertions == insertions.Block); differences.NumberOfDifferences += diff.NumberOfDifferences; differences.NumberOfSimilarities += diff.NumberOfSimilarities; if (differences.NumberOfDifferences == 0){ differences.Changes = null; differences.Deletions = null; differences.Insertions = null; }else{ differences.Changes = changes; differences.Deletions = deletions; differences.Insertions = insertions; } return differences; }
public override Statement VisitFaultHandler(FaultHandler faultHandler) { if (faultHandler == null) return null; return base.VisitFaultHandler((FaultHandler)faultHandler.Clone()); }