return result;
}
- private void writeRule(DefaultInputFile file, SyntaxHighlightingRule rule, StringBuilder[] highlightingPerLine, int currentLineIdx) {
+ private void writeRule(DefaultInputFile file, SyntaxHighlightingRule rule, StringBuilder[] highlightingPerLine, int currentLine) {
+ int currentLineIdx = currentLine;
// We know current rule starts on current line
long ruleStartOffsetCurrentLine = rule.getStartPosition();
while (currentLineIdx < file.lines() && rule.getEndPosition() >= file.originalLineOffsets()[currentLineIdx]) {
}
private DefaultIssue newIssue(Violation violation) {
- return (DefaultIssue) new DefaultIssueBuilder()
+ return new DefaultIssueBuilder()
.componentKey(violation.getResource().getEffectiveKey())
// Project can be null but Violation not used by scan2
.projectKey(project.getRoot().getEffectiveKey())
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.InputFile.Status;
-import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.fs.internal.DeprecatedDefaultInputFile;
import org.sonar.api.resources.File;
import org.sonar.api.resources.Languages;
migration.migrateIfNeeded(module, fs);
for (InputFile inputFile : fs.inputFiles(fs.predicates().all())) {
- DefaultInputFile defaultInputFile = (DefaultInputFile) inputFile;
String languageKey = inputFile.language();
boolean unitTest = InputFile.Type.TEST == inputFile.type();
String pathFromSourceDir = ((DeprecatedDefaultInputFile) inputFile).pathRelativeToSourceDir();
}
private DsmCell[][] initCells(Set<Edge> feedbackEdges) {
- DsmCell[][] cells = new DsmCell[dimension][dimension];
+ DsmCell[][] result = new DsmCell[dimension][dimension];
for (int x = 0; x < dimension; x++) {
for (int y = 0; y < dimension; y++) {
V from = vertices[x];
if (edge != null) {
atLeastOneDependency = true;
boolean isFeedbackEdge = feedbackEdges.contains(edge);
- cells[x][y] = new DsmCell(edge, isFeedbackEdge);
+ result[x][y] = new DsmCell(edge, isFeedbackEdge);
}
}
}
- return cells;
+ return result;
}
private V[] initVertices(Collection<V> verticesCol) {
- V[] vertices = (V[]) new Object[dimension];
+ V[] result = (V[]) new Object[dimension];
int i = 0;
for (V vertex : verticesCol) {
- vertices[i] = vertex;
+ result[i] = vertex;
i++;
}
- return vertices;
+ return result;
}
public V getVertex(int rowIndex) {
}
private Duration(int days, int hours, int minutes, int hoursInDay) {
- this(((long) days * hoursInDay * MINUTES_IN_ONE_HOUR) + (hours * MINUTES_IN_ONE_HOUR) + minutes);
+ this((days * hoursInDay * MINUTES_IN_ONE_HOUR) + (hours * MINUTES_IN_ONE_HOUR) + minutes);
}
/**
}
static WorkDuration createFromMinutes(long duration, int hoursInDay) {
- int days = ((Double) ((double) duration / hoursInDay / 60d)).intValue();
+ int days = ((Double) (duration / hoursInDay / 60d)).intValue();
Long currentDurationInMinutes = duration - (60L * days * hoursInDay);
int hours = ((Double) (currentDurationInMinutes / 60d)).intValue();
currentDurationInMinutes = currentDurationInMinutes - (60L * hours);