in src/main/java/org/apache/sling/scripting/xproc/xpl/impl/AbstractXplElementImpl.java [50:73]
public void addChild(XplElement child) {
if (child == null) {
String msg = "Element of class " + this.getClass().getName() + " received null child.";
this.log.error(msg);
throw new IllegalArgumentException(msg);
}
Field childField = this.getChildField(child);
if (childField != null) {
childField.setAccessible(true);
try {
childField.set(this, child);
} catch (IllegalArgumentException e) {
this.log.error("Failed to set child field for child class '" + child.getClass().getName(), e);
} catch (IllegalAccessException e) {
this.log.error("Failed to set child field for child class '" + child.getClass().getName(), e);
}
}
child.setDepth(this.getDepth() + 1);
this.children.add(child);
child.setParent(this);
}