public static HashSet <ITypeReference> ExplicitlyThrownExceptions(ExceptionAnalyzer parent, IMethodDefinition methodDefinition) { var me = new MethodExceptionAnalyzer(parent); me.Traverse(methodDefinition); return(me.exceptionsThrown); }
public static Predicate<IMethodDefinition> ComputeExplicitlyThrownExceptions(IEnumerable<IUnit> units) { var me = new ExceptionAnalyzer(); do { me.resultsChanged = false; foreach (var u in units) me.Traverse(u.UnitNamespaceRoot); } while (me.resultsChanged); return m => m != null && me.exceptionsExplicitlyThrownByMethod.ContainsKey(m); }
public static Predicate <IMethodDefinition> ComputeExplicitlyThrownExceptions(IEnumerable <IUnit> units) { var me = new ExceptionAnalyzer(); do { me.resultsChanged = false; foreach (var u in units) { me.Traverse(u.UnitNamespaceRoot); } } while (me.resultsChanged); return(m => m != null && me.exceptionsExplicitlyThrownByMethod.ContainsKey(m)); }
public override void TranslateAssemblies(IEnumerable <IUnit> assemblies) { #region traverse all of the units gathering type information var typeRecorder = new RecordSubtypes(this.parent.subTypes); foreach (var a in assemblies) { this.codeUnderAnalysis.Add(a, true); typeRecorder.Traverse((IAssembly)a); } #endregion #region Possibly gather exception information if (sink.Options.modelExceptions == 1) { this.sink.MethodThrowsExceptions = ExceptionAnalyzer.ComputeExplicitlyThrownExceptions(assemblies); } #endregion base.TranslateAssemblies(assemblies); }
private MethodExceptionAnalyzer(ExceptionAnalyzer parent) { this.parent = parent; this.exceptionsThrown = new HashSet <ITypeReference>(); }
public static HashSet<ITypeReference> ExplicitlyThrownExceptions(ExceptionAnalyzer parent, IMethodDefinition methodDefinition) { var me = new MethodExceptionAnalyzer(parent); me.Traverse(methodDefinition); return me.exceptionsThrown; }
private MethodExceptionAnalyzer(ExceptionAnalyzer parent) { this.parent = parent; this.exceptionsThrown = new HashSet<ITypeReference>(); }