aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2019-06-04 09:48:31 -0500
committerSonarTech <sonartech@sonarsource.com>2019-07-12 20:21:13 +0200
commitbe4e3879670cfe7c26bd1cfed28e29a7b20d2e2a (patch)
tree5ed538118878fb6c49698082a09b8f8b8775ec48
parente3a0108ef0dd26689dc58198e85ba8655c77fb1f (diff)
downloadsonarqube-be4e3879670cfe7c26bd1cfed28e29a7b20d2e2a.tar.gz
sonarqube-be4e3879670cfe7c26bd1cfed28e29a7b20d2e2a.zip
Extract implementation from plugin API - Scanner rules
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/package-info.java23
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ActiveRulesPublisher.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/ActiveRulesBuilder.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/ActiveRulesBuilder.java)2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/ActiveRulesProvider.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultActiveRule.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultActiveRule.java)2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultActiveRules.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultActiveRules.java)2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRule.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultRule.java)2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRuleParam.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultRuleParam.java)2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRules.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/NewActiveRule.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewActiveRule.java)2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/NewRule.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRule.java)4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/NewRuleParam.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRuleParam.java)2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/RulesBuilder.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/RulesProvider.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/SensorContextTester.java2
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java6
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ActiveRulesPublisherTest.java4
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/ModuleSensorContextTest.java2
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/ModuleSensorOptimizerTest.java4
19 files changed, 21 insertions, 48 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/package-info.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/package-info.java
deleted file mode 100644
index 30974c64071..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.api.batch.rule.internal;
-
-import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ActiveRulesPublisher.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ActiveRulesPublisher.java
index d8677af3bce..f0f8991c073 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ActiveRulesPublisher.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ActiveRulesPublisher.java
@@ -20,7 +20,7 @@
package org.sonar.scanner.report;
import org.sonar.api.batch.rule.ActiveRules;
-import org.sonar.api.batch.rule.internal.DefaultActiveRule;
+import org.sonar.scanner.rule.DefaultActiveRule;
import org.sonar.scanner.protocol.Constants;
import org.sonar.scanner.protocol.output.ScannerReport;
import org.sonar.scanner.protocol.output.ScannerReportWriter;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/ActiveRulesBuilder.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/ActiveRulesBuilder.java
index e27daa0f72f..ce5885836a2 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/ActiveRulesBuilder.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/ActiveRulesBuilder.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.batch.rule.internal;
+package org.sonar.scanner.rule;
import org.sonar.api.batch.rule.ActiveRules;
import org.sonar.api.rule.RuleKey;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/ActiveRulesProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/ActiveRulesProvider.java
index d0cc5796176..f918a847f2b 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/ActiveRulesProvider.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/ActiveRulesProvider.java
@@ -27,8 +27,6 @@ import java.util.Map;
import java.util.Set;
import org.picocontainer.injectors.ProviderAdapter;
import org.sonar.api.batch.rule.ActiveRules;
-import org.sonar.api.batch.rule.internal.ActiveRulesBuilder;
-import org.sonar.api.batch.rule.internal.NewActiveRule;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultActiveRule.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultActiveRule.java
index 9d4af800978..68bdf1ed3af 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultActiveRule.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultActiveRule.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.batch.rule.internal;
+package org.sonar.scanner.rule;
import java.util.Collections;
import java.util.HashMap;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultActiveRules.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultActiveRules.java
index 845137acf60..77a278772cc 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultActiveRules.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultActiveRules.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.batch.rule.internal;
+package org.sonar.scanner.rule;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultRule.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRule.java
index b4edd1f23ce..d53859ad348 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultRule.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRule.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.batch.rule.internal;
+package org.sonar.scanner.rule;
import java.util.Collection;
import java.util.Collections;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultRuleParam.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRuleParam.java
index a1a1d9acbb1..31fed46d547 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultRuleParam.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRuleParam.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.batch.rule.internal;
+package org.sonar.scanner.rule;
import org.sonar.api.batch.rule.RuleParam;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRules.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRules.java
index def001211e7..efcc7104b6e 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRules.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/DefaultRules.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.batch.rule.internal;
+package org.sonar.scanner.rule;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewActiveRule.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/NewActiveRule.java
index 653c333a394..10867a5b29d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewActiveRule.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/NewActiveRule.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.batch.rule.internal;
+package org.sonar.scanner.rule;
import java.util.HashMap;
import java.util.Map;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRule.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/NewRule.java
index 44135366318..179768d1c7b 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRule.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/NewRule.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.batch.rule.internal;
+package org.sonar.scanner.rule;
import java.util.HashMap;
import java.util.Map;
@@ -42,7 +42,7 @@ public class NewRule {
RuleStatus status = RuleStatus.defaultStatus();
Map<String, NewRuleParam> params = new HashMap<>();
- NewRule(RuleKey key) {
+ public NewRule(RuleKey key) {
this.key = key;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRuleParam.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/NewRuleParam.java
index a274b56042a..9fa482553c5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRuleParam.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/NewRuleParam.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.batch.rule.internal;
+package org.sonar.scanner.rule;
import javax.annotation.Nullable;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/RulesBuilder.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/RulesBuilder.java
index f7ebe363d09..3d1ccb33db5 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/RulesBuilder.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/RulesBuilder.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.batch.rule.internal;
+package org.sonar.scanner.rule;
import org.sonar.api.batch.rule.Rules;
import org.sonar.api.rule.RuleKey;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/RulesProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/RulesProvider.java
index cb7bff1bb40..a0c89c2d6f0 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/RulesProvider.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/rule/RulesProvider.java
@@ -22,8 +22,6 @@ package org.sonar.scanner.rule;
import java.util.List;
import org.picocontainer.injectors.ProviderAdapter;
import org.sonar.api.batch.rule.Rules;
-import org.sonar.api.batch.rule.internal.NewRule;
-import org.sonar.api.batch.rule.internal.RulesBuilder;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/SensorContextTester.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/SensorContextTester.java
index 6e81544e146..21e5a8271ca 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/SensorContextTester.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/SensorContextTester.java
@@ -44,7 +44,7 @@ import org.sonar.api.batch.fs.internal.DefaultInputModule;
import org.sonar.api.batch.fs.internal.DefaultInputProject;
import org.sonar.api.batch.fs.internal.DefaultTextPointer;
import org.sonar.api.batch.rule.ActiveRules;
-import org.sonar.api.batch.rule.internal.ActiveRulesBuilder;
+import org.sonar.scanner.rule.ActiveRulesBuilder;
import org.sonar.api.batch.sensor.Sensor;
import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.batch.sensor.code.NewSignificantCode;
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java
index 3e371c728fc..9a89d6ad18b 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java
@@ -35,9 +35,9 @@ import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.fs.internal.DefaultInputProject;
import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
-import org.sonar.api.batch.rule.internal.ActiveRulesBuilder;
-import org.sonar.api.batch.rule.internal.NewActiveRule;
-import org.sonar.api.batch.rule.internal.RulesBuilder;
+import org.sonar.scanner.rule.ActiveRulesBuilder;
+import org.sonar.scanner.rule.NewActiveRule;
+import org.sonar.scanner.rule.RulesBuilder;
import org.sonar.api.batch.sensor.issue.internal.DefaultExternalIssue;
import org.sonar.api.batch.sensor.issue.internal.DefaultIssue;
import org.sonar.api.batch.sensor.issue.internal.DefaultIssueLocation;
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ActiveRulesPublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ActiveRulesPublisherTest.java
index 5042436ac00..6293696adc4 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ActiveRulesPublisherTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ActiveRulesPublisherTest.java
@@ -24,8 +24,8 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.sonar.api.batch.rule.ActiveRules;
-import org.sonar.api.batch.rule.internal.DefaultActiveRules;
-import org.sonar.api.batch.rule.internal.NewActiveRule;
+import org.sonar.scanner.rule.DefaultActiveRules;
+import org.sonar.scanner.rule.NewActiveRule;
import org.sonar.api.rule.RuleKey;
import org.sonar.core.util.CloseableIterator;
import org.sonar.scanner.protocol.Constants;
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/ModuleSensorContextTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/ModuleSensorContextTest.java
index 9808538b302..f64ba90b3f1 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/ModuleSensorContextTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/ModuleSensorContextTest.java
@@ -32,7 +32,7 @@ import org.sonar.api.batch.fs.internal.DefaultFileSystem;
import org.sonar.api.batch.fs.internal.DefaultInputProject;
import org.sonar.api.batch.measure.MetricFinder;
import org.sonar.api.batch.rule.ActiveRules;
-import org.sonar.api.batch.rule.internal.ActiveRulesBuilder;
+import org.sonar.scanner.rule.ActiveRulesBuilder;
import org.sonar.api.batch.sensor.internal.SensorStorage;
import org.sonar.api.config.internal.MapSettings;
import org.sonar.api.internal.SonarRuntimeImpl;
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/ModuleSensorOptimizerTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/ModuleSensorOptimizerTest.java
index 7c5fe360a59..2a31dae65cc 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/ModuleSensorOptimizerTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/ModuleSensorOptimizerTest.java
@@ -28,8 +28,8 @@ import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.internal.DefaultFileSystem;
import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
import org.sonar.api.batch.rule.ActiveRules;
-import org.sonar.api.batch.rule.internal.ActiveRulesBuilder;
-import org.sonar.api.batch.rule.internal.NewActiveRule;
+import org.sonar.scanner.rule.ActiveRulesBuilder;
+import org.sonar.scanner.rule.NewActiveRule;
import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;
import org.sonar.api.config.internal.MapSettings;
import org.sonar.api.rule.RuleKey;