@@ -30,6 +30,12 @@ public class GsonUser { | |||
private String name; | |||
private String email; | |||
public GsonUser() { | |||
// even if empty constructor is not required for Gson, it is strongly | |||
// recommended: | |||
// http://stackoverflow.com/a/18645370/229031 | |||
} | |||
public long getId() { | |||
return id; | |||
} |
@@ -84,7 +84,7 @@ public class MeasureComputerDefinitionImpl implements MeasureComputer.MeasureCom | |||
private String[] inputMetricKeys = new String[] {}; | |||
@CheckForNull | |||
private String[] outputMetrics; | |||
private String[] outputMetrics = null; | |||
@Override | |||
public Builder setInputMetrics(String... inputMetrics) { |
@@ -24,7 +24,7 @@ import java.util.Objects; | |||
public class BatchReportDirectoryHolderImpl implements MutableBatchReportDirectoryHolder { | |||
private File directory; | |||
private File directory = null; | |||
@Override | |||
public void setDirectory(File newDirectory) { |
@@ -351,7 +351,7 @@ public class ComponentTreeBuilder { | |||
private static class Node { | |||
private final Map<String, Node> children = new LinkedHashMap<>(); | |||
private ScannerReport.Component reportComponent; | |||
private ScannerReport.Component reportComponent = null; | |||
private Map<String, Node> children() { | |||
return children; |
@@ -25,7 +25,7 @@ import static com.google.common.base.Preconditions.checkState; | |||
public class DisabledComponentsHolderImpl implements MutableDisabledComponentsHolder { | |||
private Set<String> uuids; | |||
private Set<String> uuids = null; | |||
@Override | |||
public Set<String> getUuids() { |
@@ -33,14 +33,12 @@ import static org.sonar.ce.task.projectanalysis.component.ComponentVisitor.Order | |||
*/ | |||
public class TreeRootHolderImpl implements MutableTreeRootHolder { | |||
@CheckForNull | |||
private Map<Integer, Component> componentsByRef; | |||
private Map<Integer, Component> componentsByRef = null; | |||
@CheckForNull | |||
private Map<Integer, Component> extendedComponentsByRef; | |||
private int size; | |||
private Component root; | |||
private Component extendedTreeRoot; | |||
private Map<Integer, Component> extendedComponentsByRef = null; | |||
private int size = 0; | |||
private Component root = null; | |||
private Component extendedTreeRoot = null; | |||
@Override | |||
public boolean isEmpty() { |
@@ -38,7 +38,7 @@ import org.sonar.server.platform.ServerFileSystem; | |||
public class ComputationTempFolderProvider extends ProviderAdapter implements ComponentLifecycle<TempFolder> { | |||
private boolean started = false; | |||
@CheckForNull | |||
private DefaultTempFolder tempFolder; | |||
private DefaultTempFolder tempFolder = null; | |||
public TempFolder provide(ServerFileSystem fs) { | |||
if (this.tempFolder == null) { |
@@ -22,13 +22,13 @@ package org.sonar.db.newcodeperiod; | |||
import javax.annotation.CheckForNull; | |||
public class NewCodePeriodDto { | |||
private String uuid; | |||
private String projectUuid; | |||
private String branchUuid; | |||
private NewCodePeriodType type; | |||
private String value; | |||
private long updatedAt; | |||
private long createdAt; | |||
private String uuid = null; | |||
private String projectUuid = null; | |||
private String branchUuid = null; | |||
private NewCodePeriodType type = null; | |||
private String value = null; | |||
private long updatedAt = 0L; | |||
private long createdAt = 0L; | |||
public static NewCodePeriodDto defaultInstance() { | |||
return new NewCodePeriodDto().setType(NewCodePeriodType.PREVIOUS_VERSION); |
@@ -36,7 +36,7 @@ import static org.sonar.api.utils.Preconditions.checkState; | |||
public class RulesDefinitionContext extends RulesDefinition.Context { | |||
private final Map<String, RulesDefinition.Repository> repositoriesByKey = new HashMap<>(); | |||
private String currentPluginKey; | |||
private String currentPluginKey = null; | |||
@Override | |||
public RulesDefinition.NewRepository createRepository(String key, String language) { |
@@ -359,7 +359,7 @@ public interface RulesDefinition { | |||
*/ | |||
class Context extends AbstractContext { | |||
private final Map<String, Repository> repositoriesByKey = new HashMap<>(); | |||
private String currentPluginKey; | |||
private String currentPluginKey = null; | |||
@Override | |||
public RulesDefinition.NewRepository createRepository(String key, String language) { |
@@ -112,12 +112,20 @@ public class ScannerPluginInstaller implements PluginInstaller { | |||
private static class InstalledPlugins { | |||
InstalledPlugin[] plugins; | |||
public InstalledPlugins() { | |||
// http://stackoverflow.com/a/18645370/229031 | |||
} | |||
} | |||
static class InstalledPlugin { | |||
String key; | |||
String hash; | |||
long updatedAt; | |||
public InstalledPlugin() { | |||
// http://stackoverflow.com/a/18645370/229031 | |||
} | |||
} | |||
private static class Loaded { |
@@ -101,6 +101,10 @@ public class ReportParser { | |||
static class Report { | |||
Issue[] issues; | |||
public Report() { | |||
// http://stackoverflow.com/a/18645370/229031 | |||
} | |||
} | |||
static class Issue { | |||
@@ -113,6 +117,10 @@ public class ReportParser { | |||
Location primaryLocation; | |||
@Nullable | |||
Location[] secondaryLocations; | |||
public Issue() { | |||
// http://stackoverflow.com/a/18645370/229031 | |||
} | |||
} | |||
static class Location { | |||
@@ -121,6 +129,10 @@ public class ReportParser { | |||
String filePath; | |||
@Nullable | |||
TextRange textRange; | |||
public Location() { | |||
// http://stackoverflow.com/a/18645370/229031 | |||
} | |||
} | |||
static class TextRange { | |||
@@ -131,5 +143,9 @@ public class ReportParser { | |||
Integer endLine; | |||
@Nullable | |||
Integer endColumn; | |||
public TextRange() { | |||
// http://stackoverflow.com/a/18645370/229031 | |||
} | |||
} | |||
} |
@@ -123,6 +123,10 @@ public class DefaultMetricsRepositoryLoader implements MetricsRepositoryLoader { | |||
private int ps; | |||
public WsMetricsResponse() { | |||
// http://stackoverflow.com/a/18645370/229031 | |||
} | |||
public int getTotal() { | |||
return total; | |||
} |