}
}
@Override
public void store(org.sonar.api.batch.sensor.dependency.Dependency dep) {
File fromResource = getFile(dep.from());
File toResource = getFile(dep.to());
if (sonarIndex.getEdge(fromResource, toResource) != null) {
throw new IllegalStateException("Dependency between " + dep.from() + " and " + dep.to() + " was already saved.");
}
Directory fromParent = fromResource.getParent();
Directory toParent = toResource.getParent();
Dependency parentDep = null;
if (!fromParent.equals(toParent)) {
parentDep = sonarIndex.getEdge(fromParent, toParent);
if (parentDep != null) {
parentDep.setWeight(parentDep.getWeight() + 1);