public ConstructorDefImpl(String className, IConstructorArg[] args, bool injectable) { this.args = args; this.className = className; if (injectable) { var duplicateItems = from x in args group x by x into grouped where grouped.Count() > 1 select grouped.Key; if (duplicateItems.Any()) { throw new ClassHierarchyException( "Repeated constructor parameter detected. " + "Cannot inject constructor " + ToString()); } } }
public ConstructorDefImpl(string className, IConstructorArg[] args, bool injectable) { this.args = args; this.className = className; if (injectable) { var duplicateItems = from x in args group x by x into grouped where grouped.Count() > 1 select grouped.Key; if (duplicateItems.Any()) { var e = new ClassHierarchyException( "Repeated constructor parameter detected. " + "Cannot inject constructor " + ToString()); Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER); } } }
private static StringBuilder Join(StringBuilder sb, String sep, IConstructorArg[] types) { if (types.Length > 0) { sb.Append(types[0].GetType()); for (int i = 1; i < types.Length; i++) { sb.Append(sep).Append(types[i].GetType()); } } return sb; }