diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-05-27 15:57:20 +0200 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-05-27 16:06:37 +0200 |
commit | e2136eabb58be699e3caf541efd4cfe7bb8c7e9f (patch) | |
tree | a4935a7d35c9009ff25b3eb3498cff15c24ce524 /sonar-batch | |
parent | 2a80f3d0b52a0859d35b8582ac059932b3b0c0f8 (diff) | |
download | sonarqube-e2136eabb58be699e3caf541efd4cfe7bb8c7e9f.tar.gz sonarqube-e2136eabb58be699e3caf541efd4cfe7bb8c7e9f.zip |
SONAR-2475 remove org.sonar.api.checks.checkers and org.sonar.api.checks.profiles
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/CheckProfileProvider.java | 64 | ||||
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java | 1 |
2 files changed, 0 insertions, 65 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/CheckProfileProvider.java b/sonar-batch/src/main/java/org/sonar/batch/CheckProfileProvider.java deleted file mode 100644 index cfe58e7aec4..00000000000 --- a/sonar-batch/src/main/java/org/sonar/batch/CheckProfileProvider.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2011 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar 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. - * - * Sonar 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 Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.batch; - -import org.picocontainer.injectors.ProviderAdapter; -import org.sonar.api.checks.profiles.Check; -import org.sonar.api.checks.profiles.CheckProfile; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.rules.ActiveRule; -import org.sonar.api.rules.ActiveRuleParam; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class CheckProfileProvider extends ProviderAdapter { - - private CheckProfile profile = null; - - public CheckProfile provide(RulesProfile ruleProfile) { - if (profile == null) { - profile = new CheckProfile(ruleProfile.getName(), ruleProfile.getLanguage()); - for (ActiveRule activeRule : ruleProfile.getActiveRules()) { - Check check = toCheck(activeRule); - profile.addCheck(check); - } - } - return profile; - } - - private Check toCheck(ActiveRule activeRule) { - Check check = new Check(activeRule.getPluginName(), activeRule.getRuleKey()); - check.setPriority(activeRule.getSeverity().toCheckPriority()); - check.setProperties(toParameters(activeRule.getActiveRuleParams())); - return check; - } - - private Map<String, String> toParameters(List<ActiveRuleParam> params) { - Map<String, String> map = new HashMap<String, String>(); - if (params != null) { - for (ActiveRuleParam param : params) { - map.put(param.getRuleParam().getKey(), param.getValue()); - } - } - return map; - } -} diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java index 7f1827a9808..1ea854e61de 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java @@ -95,7 +95,6 @@ public class ProjectModule extends Module { addComponent(PastViolationsLoader.class); addComponent(ProfileLoader.class, DefaultProfileLoader.class); addAdapter(new ProfileProvider()); - addAdapter(new CheckProfileProvider()); } private void addCoreComponents() { |