From 639196607fd5d138a239a09e76f0be8ab20900c8 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 21 Aug 2016 05:27:37 +0200 Subject: [PATCH] sonar Java plugin: non required Sensor because we will be running whenever JavaSquidSensor runs JavaSquidSensor calls CustomRulesCheckRegistrar --- .../example/plugins/custom/java/CustomSensor.java | 21 --------------------- .../src/test/files/checks/ParameterCheck.java | 4 ++-- 2 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 Sonar/Plugins/sonar-custom-java-plugin/src/main/java/de/example/plugins/custom/java/CustomSensor.java diff --git a/Sonar/Plugins/sonar-custom-java-plugin/src/main/java/de/example/plugins/custom/java/CustomSensor.java b/Sonar/Plugins/sonar-custom-java-plugin/src/main/java/de/example/plugins/custom/java/CustomSensor.java deleted file mode 100644 index a00c662..0000000 --- a/Sonar/Plugins/sonar-custom-java-plugin/src/main/java/de/example/plugins/custom/java/CustomSensor.java +++ /dev/null @@ -1,21 +0,0 @@ -package de.example.plugins.custom.java; - -import org.sonar.api.batch.sensor.Sensor; -import org.sonar.api.batch.sensor.SensorContext; -import org.sonar.api.batch.sensor.SensorDescriptor; -import org.sonar.plugins.java.Java; - -public class CustomSensor implements Sensor { - - @Override - public void describe(SensorDescriptor descriptor) { - descriptor.onlyOnLanguage(Java.KEY); - descriptor.name("Custom Java Sensor"); - } - - @Override - public void execute(SensorContext context) { - - } - -} diff --git a/Sonar/Plugins/sonar-custom-java-plugin/src/test/files/checks/ParameterCheck.java b/Sonar/Plugins/sonar-custom-java-plugin/src/test/files/checks/ParameterCheck.java index 488a749..8902379 100644 --- a/Sonar/Plugins/sonar-custom-java-plugin/src/test/files/checks/ParameterCheck.java +++ b/Sonar/Plugins/sonar-custom-java-plugin/src/test/files/checks/ParameterCheck.java @@ -6,12 +6,12 @@ class MyClass { void foo2(int value) { } - // Noncompliant@+1 [[startColumn=6;endLine=+0;endColumn=10;effortToFix=4]] {{Never do that!}} + // Noncompliant@+1 [[startColumn=6;endLine=+0;endColumn=10;effortToFix=4]] {{Remove this method}} int foo3(int value) { return 0; } Object foo4(int value) { return null; } - // Noncompliant@+1 [[startColumn=10;endLine=+0;endColumn=14;effortToFix=4]] {{Never do that!}} + // Noncompliant@+1 [[startColumn=10;endLine=+0;endColumn=14;effortToFix=4]] {{Remove this method}} MyClass foo5(MyClass value) { return null; } } -- 2.1.4