public void MergeIn(ParameterParser p) { foreach (string s in p.parsers.Keys) { if (!parsers.ContainsKey(s)) { ConstructorInfo ci; p.parsers.TryGetValue(s, out ci); parsers.Add(s, ci); } else { ConstructorInfo oldC; ConstructorInfo newC; parsers.TryGetValue(s, out oldC); p.parsers.TryGetValue(s, out newC); if (!oldC.Equals(newC)) { var e = new ArgumentException( "Conflict detected when merging parameter parsers! To parse " + s + " I have a: " + ReflectionUtilities.GetAssemblyQualifiedName(oldC.DeclaringType) + " the other instance has a: " + ReflectionUtilities.GetAssemblyQualifiedName(newC.DeclaringType)); Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER); } } } }
public void MergeIn(ParameterParser p) { foreach (string s in p.parsers.Keys) { if (!parsers.ContainsKey(s)) { ConstructorInfo ci; p.parsers.TryGetValue(s, out ci); parsers.Add(s, ci); } else { ConstructorInfo oldC; ConstructorInfo newC; parsers.TryGetValue(s, out oldC); p.parsers.TryGetValue(s, out newC); if (!oldC.Equals(newC)) { var e = new ArgumentException( "Conflict detected when merging parameter parsers! To parse " + s + " I have a: " + ReflectionUtilities.GetAssemblyQualifiedName(oldC.DeclaringType) + " the other instance has a: " + ReflectionUtilities.GetAssemblyQualifiedName(newC.DeclaringType)); Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER); } } } }