import com.persistit.encoding.ValueCoder;
import java.util.ArrayList;
+import java.util.List;
public class SyntaxHighlightingDataValueCoder implements ValueCoder {
@Override
public Object get(Value value, Class clazz, CoderContext context) {
int count = value.getInt();
- ArrayList<SyntaxHighlightingRule> rules = new ArrayList<SyntaxHighlightingRule>(count);
+ List<SyntaxHighlightingRule> rules = new ArrayList<SyntaxHighlightingRule>(count);
for (int i = 0; i < count; i++) {
rules.add((SyntaxHighlightingRule) rulesCoder.get(value, SyntaxHighlightingRule.class, context));
}
*/
package org.sonar.batch.mediumtest;
-import org.sonar.api.batch.sensor.highlighting.TypeOfText;
-
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.batch.fs.InputPath;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.sensor.duplication.DuplicationGroup;
+import org.sonar.api.batch.sensor.highlighting.TypeOfText;
import org.sonar.api.batch.sensor.issue.Issue;
import org.sonar.api.batch.sensor.measure.Measure;
import org.sonar.api.batch.sensor.symbol.Symbol;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
* Get highlighting types at a given position in an inputfile
* @param charIndex 0-based offset in file
*/
- @CheckForNull
public List<TypeOfText> highlightingTypeFor(InputFile file, int charIndex) {
SyntaxHighlightingData syntaxHighlightingData = highlightingPerFile.get(file);
if (syntaxHighlightingData == null) {
- return null;
+ return Collections.emptyList();
}
List<TypeOfText> result = new ArrayList<TypeOfText>();
for (SyntaxHighlightingRule sortedRule : syntaxHighlightingData.syntaxHighlightingRuleSet()) {