aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-batch/src/main/java')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginPredicate.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/profiling/AbstractTimeProfiling.java12
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java11
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java24
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/repository/language/Language.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/rule/QProfile.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializer.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ProjectFileSystemAdapter.java18
10 files changed, 56 insertions, 29 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginPredicate.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginPredicate.java
index b68a51b1bf2..435b53d10db 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginPredicate.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginPredicate.java
@@ -48,7 +48,8 @@ public class BatchPluginPredicate implements Predicate<String> {
private static final String PROPERTY_IS_DEPRECATED_MSG = "Property {0} is deprecated. Please use {1} instead.";
private static final Joiner COMMA_JOINER = Joiner.on(", ");
- private final Set<String> whites = newHashSet(), blacks = newHashSet();
+ private final Set<String> whites = newHashSet();
+ private final Set<String> blacks = newHashSet();
private final DefaultAnalysisMode mode;
public BatchPluginPredicate(Settings settings, DefaultAnalysisMode mode) {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java b/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java
index a85eb172cf7..719800f8231 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java
@@ -38,7 +38,8 @@ import static org.sonar.api.utils.DateUtils.longToDate;
public class PastSnapshot {
private int index;
- private String mode, modeParameter;
+ private String mode;
+ private String modeParameter;
private Snapshot projectSnapshot;
private Date targetDate = null;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/profiling/AbstractTimeProfiling.java b/sonar-batch/src/main/java/org/sonar/batch/profiling/AbstractTimeProfiling.java
index 687adba5178..48d051bf86e 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/profiling/AbstractTimeProfiling.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/profiling/AbstractTimeProfiling.java
@@ -19,13 +19,17 @@
*/
package org.sonar.batch.profiling;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Nullable;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.TimeUtils;
-import javax.annotation.Nullable;
-
-import java.util.*;
-
public abstract class AbstractTimeProfiling {
private final long startTime;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java b/sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java
index f4bae408420..72f150aa9c5 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java
@@ -20,14 +20,15 @@
package org.sonar.batch.profiling;
import com.google.common.collect.Maps;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import javax.annotation.Nullable;
import org.sonar.api.resources.Project;
import org.sonar.api.utils.System2;
-import javax.annotation.Nullable;
-
-import java.util.*;
-import java.util.Map.Entry;
-
public class ModuleProfiling extends AbstractTimeProfiling {
private Map<Phase, PhaseProfiling> profilingPerPhase = new HashMap<>();
diff --git a/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java b/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java
index c62c528c2fb..97e5c09dcdb 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java
@@ -21,12 +21,28 @@ package org.sonar.batch.profiling;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.HashMap;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.CoreProperties;
import org.sonar.api.batch.Decorator;
-import org.sonar.api.batch.events.*;
+import org.sonar.api.batch.events.DecoratorExecutionHandler;
+import org.sonar.api.batch.events.DecoratorsPhaseHandler;
+import org.sonar.api.batch.events.InitializerExecutionHandler;
+import org.sonar.api.batch.events.InitializersPhaseHandler;
+import org.sonar.api.batch.events.PostJobExecutionHandler;
+import org.sonar.api.batch.events.PostJobsPhaseHandler;
+import org.sonar.api.batch.events.ProjectAnalysisHandler;
+import org.sonar.api.batch.events.SensorExecutionHandler;
+import org.sonar.api.batch.events.SensorsPhaseHandler;
import org.sonar.api.resources.Project;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.TimeUtils;
@@ -36,12 +52,6 @@ import org.sonar.batch.phases.event.PersisterExecutionHandler;
import org.sonar.batch.phases.event.PersistersPhaseHandler;
import org.sonar.batch.util.BatchUtils;
-import javax.annotation.Nullable;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.util.*;
-
import static org.sonar.batch.profiling.AbstractTimeProfiling.sortByDescendingTotalTime;
import static org.sonar.batch.profiling.AbstractTimeProfiling.truncate;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/repository/language/Language.java b/sonar-batch/src/main/java/org/sonar/batch/repository/language/Language.java
index 12241dab086..fcbf1e74c3e 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/repository/language/Language.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/repository/language/Language.java
@@ -24,7 +24,8 @@ import java.util.Collection;
public final class Language {
- private final String key, name;
+ private final String key;
+ private final String name;
private final String[] fileSuffixes;
public Language(String key, String name, String... fileSuffixes) {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/rule/QProfile.java b/sonar-batch/src/main/java/org/sonar/batch/rule/QProfile.java
index 73bca934108..8ea56afa10c 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/rule/QProfile.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/rule/QProfile.java
@@ -25,7 +25,9 @@ import java.util.Date;
public class QProfile {
- private String key, name, language;
+ private String key;
+ private String name;
+ private String language;
private Date rulesUpdatedAt;
public String getKey() {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
index cc3e3798f07..10fa76df9be 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
@@ -438,7 +438,8 @@ public class ProjectReactorBuilder {
@VisibleForTesting
protected static File[] getLibraries(File baseDir, String pattern) {
final int i = Math.max(pattern.lastIndexOf('/'), pattern.lastIndexOf('\\'));
- final String dirPath, filePattern;
+ final String dirPath;
+ final String filePattern;
if (i == -1) {
dirPath = ".";
filePattern = pattern;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializer.java
index d9e31778a3d..fd2e8a9226a 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializer.java
@@ -37,7 +37,9 @@ import java.util.List;
@BatchSide
public class ModuleFileSystemInitializer {
- private File baseDir, workingDir, buildDir;
+ private File baseDir;
+ private File workingDir;
+ private File buildDir;
private List<File> sourceDirsOrFiles = Lists.newArrayList();
private List<File> testDirsOrFiles = Lists.newArrayList();
private List<File> binaryDirs = Lists.newArrayList();
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ProjectFileSystemAdapter.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ProjectFileSystemAdapter.java
index 6bef676b656..20390af7c84 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ProjectFileSystemAdapter.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ProjectFileSystemAdapter.java
@@ -21,18 +21,22 @@ package org.sonar.batch.scan.filesystem;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.CharEncoding;
-import org.sonar.api.batch.fs.FilePredicate;
-import org.sonar.api.resources.*;
-import org.sonar.api.scan.filesystem.PathResolver;
-import org.sonar.api.utils.SonarException;
-
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.List;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.CharEncoding;
+import org.sonar.api.batch.fs.FilePredicate;
+import org.sonar.api.resources.InputFile;
+import org.sonar.api.resources.Java;
+import org.sonar.api.resources.Language;
+import org.sonar.api.resources.Project;
+import org.sonar.api.resources.ProjectFileSystem;
+import org.sonar.api.resources.Resource;
+import org.sonar.api.scan.filesystem.PathResolver;
+import org.sonar.api.utils.SonarException;
/**
* Adapter for keeping the backward-compatibility of the deprecated component {@link org.sonar.api.resources.ProjectFileSystem}