internal ExceptionSources (TypeReference exception)
{
Exception = exception;
- SourcesList = new List<MemberReference> ();
- Sources = new ReadOnlyCollection<MemberReference> (SourcesList);
+ Sources = new HashSet<MemberReference> ();
}
public TypeReference Exception { get; private set; }
- public ReadOnlyCollection<MemberReference> Sources { get; private set; }
- internal List<MemberReference> SourcesList;
+ internal HashSet<MemberReference> Sources;
}
Dictionary<string, ExceptionSources> e;
if (!db.TryGetValue (memberDecl, out e)) {
e = new Dictionary<string, ExceptionSources> ();
+ db.Add (memberDecl, e);
var bodies = GetMethodBodies (member);
foreach (var body in bodies) {
if (body == null)
continue;
FillExceptions (body, e);
}
- db.Add (memberDecl, e);
}
return e.Values;
}
((locations & ExceptionLocations.DependentAssemblies) != 0 &&
body.Method.DeclaringType.Scope.Name != memberRef.DeclaringType.Scope.Name)) {
- if (memberRef.Resolve () == body.Method)
- break;
-
IEnumerable<ExceptionSources> memberExceptions = this [memberRef];
AddExceptions (body, instruction,
memberExceptions.Select (es => es.Exception),
s = new ExceptionSources (ex);
exceptions.Add (eName, s);
}
- s.SourcesList.AddRange (sources);
+ foreach (var m in sources)
+ s.Sources.Add (m);
}
}
}