diff options
-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) { |