From: Julien HENRY Date: Mon, 19 Jan 2015 13:49:58 +0000 (+0100) Subject: Fix some quality flaws X-Git-Tag: latest-silver-master-#65~184 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b5b2251c86b2bc832bb5e38bd4439b63035f91bd;p=sonarqube.git Fix some quality flaws --- diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/ResourcePersister.java b/sonar-batch/src/main/java/org/sonar/batch/index/ResourcePersister.java index bcfe06d3516..d4a56676b58 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/index/ResourcePersister.java +++ b/sonar-batch/src/main/java/org/sonar/batch/index/ResourcePersister.java @@ -37,7 +37,6 @@ import org.sonar.api.utils.internal.Uuids; 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; @@ -107,7 +106,6 @@ public class ResourcePersister implements ScanPersister { } } - @CheckForNull private Project findModule(BatchResource batchResource) { if (batchResource.resource() instanceof Project) { return (Project) batchResource.resource(); @@ -131,7 +129,7 @@ public class ResourcePersister implements ScanPersister { 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); diff --git a/sonar-batch/src/main/java/org/sonar/batch/phases/PreviewPhaseExecutor.java b/sonar-batch/src/main/java/org/sonar/batch/phases/PreviewPhaseExecutor.java index c3fec8e89c3..3ef7161945f 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/phases/PreviewPhaseExecutor.java +++ b/sonar-batch/src/main/java/org/sonar/batch/phases/PreviewPhaseExecutor.java @@ -19,8 +19,6 @@ */ 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; @@ -35,8 +33,6 @@ import org.sonar.batch.scan.report.JsonReport; 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;