private static final Map<State, Set<State>> TRANSITIONS = buildTransitions();
+ private State state = INIT;
+
private static Map<State, Set<State>> buildTransitions() {
Map<State, Set<State>> res = new EnumMap<>(State.class);
res.put(INIT, toSet(STARTING));
return EnumSet.copyOf(Arrays.asList(states));
}
- private State state = INIT;
-
public State getState() {
return state;
}
import org.sonar.server.computation.queue.CeQueueCleaner;
import org.sonar.server.computation.queue.CeQueueInitializer;
import org.sonar.server.computation.queue.InternalCeQueueImpl;
-import org.sonar.server.computation.task.projectanalysis.queue.CleanReportQueueListener;
public class CeQueueModule extends Module {
@Override
*/
package org.sonar.server.computation.task.projectanalysis.api.developer;
+import org.sonar.server.computation.task.step.ComputationStep;
+
/**
* This interface is used to delegate the persistence of developers to the Developer Cockpit plugin
*/
public interface PersistDevelopersDelegate {
+ /**
+ * The delegate's implementation of {@link ComputationStep#execute()}.
+ */
void execute();
}
? new ComponentImpl.FileAttributesImpl(component.getFileAttributes().getLanguageKey(), component.getFileAttributes().isUnitTest()) : null);
}
- private class ComponentToMeasure implements Function<org.sonar.server.computation.task.projectanalysis.component.Component, Optional<org.sonar.server.computation.task.projectanalysis.measure.Measure>> {
+ private class ComponentToMeasure implements Function<org.sonar.server.computation.task.projectanalysis.component.Component,
+ Optional<org.sonar.server.computation.task.projectanalysis.measure.Measure>> {
private final Metric metric;
private static class MatchVisitorMaxDepth implements Predicate<VisitorWrapper> {
private static final Map<Component.Type, MatchVisitorMaxDepth> INSTANCES = buildInstances();
-
private final Component.Type type;
+ private MatchVisitorMaxDepth(Component.Type type) {
+ this.type = requireNonNull(type);
+ }
+
private static Map<Component.Type, MatchVisitorMaxDepth> buildInstances() {
ImmutableMap.Builder<Component.Type, MatchVisitorMaxDepth> builder = ImmutableMap.builder();
for (Component.Type type : Component.Type.values()) {
return builder.build();
}
- private MatchVisitorMaxDepth(Component.Type type) {
- this.type = requireNonNull(type);
- }
-
public static MatchVisitorMaxDepth forComponent(Component component) {
return INSTANCES.get(component.getType());
}
*/
package org.sonar.server.computation.task.projectanalysis.metric;
-import com.google.common.base.MoreObjects;
import java.util.Objects;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
import org.sonar.server.computation.task.projectanalysis.measure.Measure;
+import static com.google.common.base.MoreObjects.firstNonNull;
+import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
this.name = checkNotNull(name);
this.type = checkNotNull(type);
if (type.getValueType() == Measure.ValueType.DOUBLE) {
- this.decimalScale = MoreObjects.firstNonNull(decimalScale, org.sonar.api.measures.Metric.DEFAULT_DECIMAL_SCALE);
+ this.decimalScale = firstNonNull(decimalScale, org.sonar.api.measures.Metric.DEFAULT_DECIMAL_SCALE);
} else {
this.decimalScale = decimalScale;
}
@Override
public String toString() {
- return com.google.common.base.MoreObjects.toStringHelper(this)
+ return toStringHelper(this)
.add("id", id)
.add("key", key)
.add("name", name)
String pluginKey = info.getKey();
if (blacklistedPluginKeys.contains(pluginKey)) {
LOG.warn("Plugin {} [{}] is blacklisted and is being uninstalled.", info.getName(), pluginKey);
- org.sonar.core.util.FileUtils.deleteQuietly(info.getNonNullJarFile());
+ deleteQuietly(info.getNonNullJarFile());
return;
}
if (FORBIDDEN_COMPATIBLE_PLUGINS.contains(pluginKey)) {
});
}
- private void cleanSnapshotWithIncorrectRoot(Context context) throws SQLException {
+ private static void cleanSnapshotWithIncorrectRoot(Context context) throws SQLException {
MassUpdate massUpdate = context.prepareMassUpdate();
massUpdate.select("select" +
" sn.id" +
return true;
}
- public void populateAnalysisUuid(Context context) throws SQLException {
+ public static void populateAnalysisUuid(Context context) throws SQLException {
MassUpdate massUpdate = context.prepareMassUpdate();
massUpdate.select("select distinct di.project_snapshot_id, s.uuid from duplications_index di" +
" inner join snapshots s on s.id=di.project_snapshot_id" +
* @since 5.5
*/
public interface Project {
+ /**
+ * The UUID of the project.
+ */
String getUuid();
+ /**
+ * The key of the project.
+ */
String getKey();
+ /**
+ * The name of the project.
+ */
String getName();
}