import org.sonar.batch.ProjectTree;
import org.sonar.core.component.ScanGraph;
-import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.persistence.NonUniqueResultException;
import javax.persistence.Query;
}
}
- @CheckForNull
private Project findModule(BatchResource batchResource) {
if (batchResource.resource() instanceof Project) {
return (Project) batchResource.resource();
Snapshot parentSnapshot = null;
if (parent != null) {
// assume that the parent project has already been saved
- parentSnapshot = resourceCache.get(project.getParent().getEffectiveKey()).snapshot();
+ parentSnapshot = resourceCache.get(parent.getEffectiveKey()).snapshot();
model.setRootId((Integer) ObjectUtils.defaultIfNull(parentSnapshot.getRootProjectId(), parentSnapshot.getResourceId()));
} else {
model.setRootId(null);
*/
package org.sonar.batch.phases;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.sonar.api.batch.SensorContext;
import org.sonar.api.resources.Project;
import org.sonar.batch.events.BatchStepEvent;
public final class PreviewPhaseExecutor implements PhaseExecutor {
- private static final Logger LOGGER = LoggerFactory.getLogger(PreviewPhaseExecutor.class);
-
private final EventBus eventBus;
private final Phases phases;
private final MavenPluginsConfigurator mavenPluginsConfigurator;