]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaw
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 31 Mar 2015 14:25:34 +0000 (16:25 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 31 Mar 2015 14:25:34 +0000 (16:25 +0200)
server/sonar-server/src/main/java/org/sonar/server/rule/RuleUpdater.java

index 69f7f2a5db54e0ddc38feab86bbdd05d89dfae8d..98476084a21352a19a835a9f97fa5e4f21d421a9 100644 (file)
@@ -216,9 +216,10 @@ public class RuleUpdater implements ServerComponent {
   }
 
   private void updateDebtRemediationFunction(RuleUpdate update, Context context) {
+    Integer subChar = context.rule.getSubCharacteristicId();
     boolean noChar =
-      (context.rule.getDefaultSubCharacteristicId() == null && context.rule.getSubCharacteristicId() == null) ||
-        (context.rule.getSubCharacteristicId() != null && context.rule.getSubCharacteristicId().intValue() == RuleDto.DISABLED_CHARACTERISTIC_ID);
+      (context.rule.getDefaultSubCharacteristicId() == null && subChar == null) ||
+        (subChar != null && subChar.intValue() == RuleDto.DISABLED_CHARACTERISTIC_ID);
 
     DebtRemediationFunction function = update.getDebtRemediationFunction();
     if (noChar || function == null) {