diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-02-04 13:43:03 +0100 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-02-04 13:43:03 +0100 |
commit | 9b57d0b379935e053ef050b0379c65fc32810bc1 (patch) | |
tree | 329c41fac9a3a490a5db3cd50cf3348fb93e2cb1 | |
parent | 181202a7bcc7764e16c05f8ad93ef748dcc1985b (diff) | |
download | sonarqube-9b57d0b379935e053ef050b0379c65fc32810bc1.tar.gz sonarqube-9b57d0b379935e053ef050b0379c65fc32810bc1.zip |
Fix bug on deprecated profiles
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java | 2 | ||||
-rw-r--r-- | sonar-server/src/main/java/org/sonar/server/rules/DeprecatedProfiles.java | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java index 2da2c6c2352..b773d4076ec 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java @@ -288,6 +288,6 @@ public class ActiveRule implements Cloneable { * @since 2.6 */ public boolean isEnabled() { - return getRule().isEnabled(); + return getRule()!=null && getRule().isEnabled(); } } diff --git a/sonar-server/src/main/java/org/sonar/server/rules/DeprecatedProfiles.java b/sonar-server/src/main/java/org/sonar/server/rules/DeprecatedProfiles.java index 40ed1877b07..7d61dc8ccb8 100644 --- a/sonar-server/src/main/java/org/sonar/server/rules/DeprecatedProfiles.java +++ b/sonar-server/src/main/java/org/sonar/server/rules/DeprecatedProfiles.java @@ -103,7 +103,7 @@ public final class DeprecatedProfiles { for (int index = 0; index < repository.getProvidedProfiles().size(); index++) { RulesProfile deprecated = (RulesProfile) repository.getProvidedProfiles().get(index); DefaultProfileDefinition providedProfile = DefaultProfileDefinition.create(deprecated.getName(), repository.getLanguage().getKey()); - for (ActiveRule deprecatedActiveRule : deprecated.getActiveRules()) { + for (ActiveRule deprecatedActiveRule : deprecated.getActiveRules(true)) { String repositoryKey = deprecatedActiveRule.getRepositoryKey(); if (StringUtils.isBlank(repositoryKey)) { repositoryKey = getPluginKey(repository); @@ -161,7 +161,7 @@ public final class DeprecatedProfiles { } public List<ActiveRule> getRules() { - return profile.getActiveRules(); + return profile.getActiveRules(true); } public List<ActiveRule> getRulesByRepositoryKey(String repositoryKey) { |