diff options
Diffstat (limited to 'sonar-batch/src/main/java/org/sonar/batch/rule/ActiveRulesProvider.java')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/rule/ActiveRulesProvider.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/rule/ActiveRulesProvider.java b/sonar-batch/src/main/java/org/sonar/batch/rule/ActiveRulesProvider.java index 95762afd79d..a7aea325d48 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/rule/ActiveRulesProvider.java +++ b/sonar-batch/src/main/java/org/sonar/batch/rule/ActiveRulesProvider.java @@ -28,6 +28,8 @@ import org.sonar.api.batch.rule.internal.NewActiveRule; import org.sonar.api.rules.Rule; import org.sonar.api.rules.RuleFinder; import org.sonar.api.rules.RuleParam; +import org.sonar.batch.api.rules.QProfile; +import org.sonar.batch.rules.QProfileWithId; import org.sonar.core.qualityprofile.db.ActiveRuleDao; import org.sonar.core.qualityprofile.db.ActiveRuleDto; import org.sonar.core.qualityprofile.db.ActiveRuleParamDto; @@ -49,13 +51,14 @@ public class ActiveRulesProvider extends ProviderAdapter { private ActiveRules load(ModuleQProfiles qProfiles, ActiveRuleDao dao, RuleFinder ruleFinder) { ActiveRulesBuilder builder = new ActiveRulesBuilder(); - for (ModuleQProfiles.QProfile qProfile : qProfiles.findAll()) { + for (QProfile qProfile : qProfiles.findAll()) { + QProfileWithId qProfileWithId = (QProfileWithId) qProfile; ListMultimap<Integer, ActiveRuleParamDto> paramDtosByActiveRuleId = ArrayListMultimap.create(); - for (ActiveRuleParamDto dto : dao.selectParamsByProfileId(qProfile.id())) { + for (ActiveRuleParamDto dto : dao.selectParamsByProfileId(qProfileWithId.id())) { paramDtosByActiveRuleId.put(dto.getActiveRuleId(), dto); } - for (ActiveRuleDto activeDto : dao.selectByProfileId(qProfile.id())) { + for (ActiveRuleDto activeDto : dao.selectByProfileId(qProfileWithId.id())) { Rule rule = ruleFinder.findById(activeDto.getRulId()); if (rule != null) { NewActiveRule newActiveRule = builder.activate(rule.ruleKey()); |