diff options
Diffstat (limited to 'plugins/sonar-xoo-plugin')
3 files changed, 7 insertions, 8 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/ChecksSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/ChecksSensor.java index 76c839d1a07..c058af0d199 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/ChecksSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/ChecksSensor.java @@ -50,7 +50,7 @@ public class ChecksSensor implements Sensor { @Override public void execute(SensorContext context) { Checks<Check> checks = checkFactory.create(XooRulesDefinition.XOO_REPOSITORY); - checks.addAnnotatedChecks((Object[]) Check.ALL); + checks.addAnnotatedChecks(Check.ALL); FilePredicates p = context.fileSystem().predicates(); for (InputFile file : context.fileSystem().inputFiles(p.and(p.hasLanguages(Xoo.KEY), p.hasType(Type.MAIN)))) { for (Check check : checks.all()) { diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/MultilineIssuesSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/MultilineIssuesSensor.java index c1592e3cf8b..7c91f7c7120 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/MultilineIssuesSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/MultilineIssuesSensor.java @@ -21,11 +21,11 @@ package org.sonar.xoo.rule; import com.google.common.collect.HashBasedTable; import com.google.common.collect.Lists; -import com.google.common.collect.Maps; import com.google.common.collect.Table; import java.io.IOException; import java.nio.file.Files; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; @@ -70,10 +70,10 @@ public class MultilineIssuesSensor implements Sensor { } private static void createIssues(InputFile file, SensorContext context) { - Map<Integer, TextPointer> startIssuesPositions = Maps.newHashMap(); - Map<Integer, TextPointer> endIssuesPositions = Maps.newHashMap(); - Map<Integer, Table<Integer, Integer, TextPointer>> startFlowsPositions = Maps.newHashMap(); - Map<Integer, Table<Integer, Integer, TextPointer>> endFlowsPositions = Maps.newHashMap(); + Map<Integer, TextPointer> startIssuesPositions = new HashMap<>(); + Map<Integer, TextPointer> endIssuesPositions = new HashMap<>(); + Map<Integer, Table<Integer, Integer, TextPointer>> startFlowsPositions = new HashMap<>(); + Map<Integer, Table<Integer, Integer, TextPointer>> endFlowsPositions = new HashMap<>(); parseIssues(file, context, startIssuesPositions, endIssuesPositions); parseFlows(file, startFlowsPositions, endFlowsPositions); diff --git a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/AnalysisErrorSensorTest.java b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/AnalysisErrorSensorTest.java index f08e3bd202a..3f2a356d707 100644 --- a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/AnalysisErrorSensorTest.java +++ b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/AnalysisErrorSensorTest.java @@ -42,7 +42,6 @@ public class AnalysisErrorSensorTest { public TemporaryFolder temp = new TemporaryFolder(); private AnalysisErrorSensor sensor; - private SensorContextTester context; @Before public void setUp() { @@ -74,7 +73,7 @@ public class AnalysisErrorSensorTest { .setModuleBaseDir(baseDir) .setLines(4) .build(); - context = SensorContextTester.create(baseDir); + SensorContextTester context = SensorContextTester.create(baseDir); context.fileSystem().add(inputFile); sensor.execute(context); |