]> source.dussan.org Git - sonarqube.git/commitdiff
Fix some quality flaws
authorJulien HENRY <julien.henry@sonarsource.com>
Mon, 19 Jan 2015 13:49:58 +0000 (14:49 +0100)
committerJulien HENRY <julien.henry@sonarsource.com>
Mon, 19 Jan 2015 13:49:58 +0000 (14:49 +0100)
sonar-batch/src/main/java/org/sonar/batch/index/ResourcePersister.java
sonar-batch/src/main/java/org/sonar/batch/phases/PreviewPhaseExecutor.java

index bcfe06d3516743562b1ee5ea87bf0fbfebd21e05..d4a56676b581c590ecb625650c8849e7fb85504d 100644 (file)
@@ -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);
index c3fec8e89c3fbb9f6aa60500ef5adf2dfb52eb96..3ef7161945f56b628bcb85a8674b67e00117d23c 100644 (file)
@@ -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;