}
}
private ChildEntry addChild1(ChildSpec spec) {
LOG.debug("Adding child {}", spec);
ActorRef actor = null;
if (spec.builder instanceof ActorRef) {
actor = (ActorRef) spec.builder;
if (findEntry(actor) != null)
throw new SupervisorException("Supervisor " + this + " already supervises actor " + actor);
}
Object id = spec.getId();
if (id == null && actor != null)
id = actor.getName();
if (id != null && findEntryById(id) != null)
throw new SupervisorException("Supervisor " + this + " already supervises an actor by the name " + id);
final ChildEntry child = new ChildEntry(spec, actor);
children.add(child);
if (id != null)