From 31f83fbcab419d16c5911583784d6cf780f8c6cf Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Wed, 13 Jul 2016 17:12:46 +0200 Subject: Fix some quality flaws --- sonar-plugin-api/src/main/java/org/sonar/api/SonarRuntime.java | 4 ++-- .../main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java | 1 + .../api/batch/sensor/highlighting/internal/DefaultHighlighting.java | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'sonar-plugin-api') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/SonarRuntime.java b/sonar-plugin-api/src/main/java/org/sonar/api/SonarRuntime.java index 0760fb77244..86b37e9e54c 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/SonarRuntime.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/SonarRuntime.java @@ -22,7 +22,7 @@ package org.sonar.api; import com.google.common.base.Preconditions; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; -import org.sonar.api.batch.BatchSide; +import org.sonar.api.batch.ScannerSide; import org.sonar.api.batch.sensor.Sensor; import org.sonar.api.ce.ComputeEngineSide; import org.sonar.api.server.ServerSide; @@ -121,7 +121,7 @@ import static java.util.Objects.requireNonNull; * * @since 6.0 */ -@BatchSide +@ScannerSide @ServerSide @ComputeEngineSide @SonarLintSide diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java index 031fa6de245..a3d4de28654 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java @@ -120,6 +120,7 @@ public class DefaultInputFile extends DefaultInputComponent implements InputFile return moduleKey; } + @Override public Charset charset() { return charset; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/internal/DefaultHighlighting.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/internal/DefaultHighlighting.java index 34df663e54a..6ccc541dad3 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/internal/DefaultHighlighting.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/internal/DefaultHighlighting.java @@ -79,8 +79,6 @@ public class DefaultHighlighting extends DefaultStorable implements NewHighlight checkInputFileNotNull(); TextRange newRange; try { - // TODO remove when SONAR-7664 is implemented - Preconditions.checkArgument(startOffset < endOffset, "start offset should be strictly before end offset"); newRange = inputFile.newRange(startOffset, endOffset); } catch (Exception e) { throw new IllegalArgumentException("Unable to highlight file " + inputFile, e); -- cgit v1.2.3