use of org.eclipse.ceylon.cmr.spi.OpenNode in project ceylon by eclipse.
the class AbstractOpenNode method link.
@Override
public void link(OpenNode child) {
if (child == null)
throw new IllegalArgumentException("Null node!");
OpenNode previous = children.putIfAbsent(child.getLabel(), child);
if (previous == null) {
if (child instanceof AbstractOpenNode) {
AbstractOpenNode dn = (AbstractOpenNode) child;
dn.parents.put(getLabel(), this);
}
} else {
MergeStrategy ms = findService(MergeStrategy.class);
ms.conflict(previous, child);
}
}
use of org.eclipse.ceylon.cmr.spi.OpenNode in project ceylon by eclipse.
the class AbstractOpenNode method put.
protected OpenNode put(ConcurrentMap<String, OpenNode> map, String label, OpenNode child) {
final OpenNode previous = map.putIfAbsent(label, child);
if (previous == null) {
if (child instanceof AbstractOpenNode) {
final AbstractOpenNode dn = (AbstractOpenNode) child;
dn.parents.put(getLabel(), this);
}
} else {
// replace
child = previous;
}
return child;
}
Aggregations