RuleDebt ruleDebt = ruleDebtByRule(rule, ruleDebts);
<BUG>if (ruleDebt == null) {
rule.setCharacteristicId(rule.getDefaultCharacteristicId() != null ? RuleDto.DISABLED_CHARACTERISTIC_ID : null);
rule.setRemediationFunction(null);
rule.setRemediationFactor(null);
rule.setRemediationOffset(null);</BUG>
} else {
<BUG>CharacteristicDto characteristicDto = characteristicByKey(ruleDebt.characteristicKey(), characteristicDtos, false);
boolean isSameCharacteristic = characteristicDto.getId().equals(rule.getDefaultCharacteristicId());</BUG>
boolean isSameFunction = isSameRemediationFunction(ruleDebt, rule);

RuleDebt ruleDebt = ruleDebtByRule(rule, ruleDebts);
if (ruleDebt == null) {
disabledRuleDebt(rule, updateDate, session);
} else {
CharacteristicDto characteristicDto = characteristicByKey(ruleDebt.characteristicKey(), characteristicDtos);
if (characteristicDto == null) {
disabledRuleDebt(rule, updateDate, session);
} else {
boolean isSameCharacteristic = characteristicDto.getId().equals(rule.getDefaultCharacteristicId());
boolean isSameFunction = isSameRemediationFunction(ruleDebt, rule);
