aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-03-06 20:20:02 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-03-06 20:20:02 +0100
commitfa9bb27d5dca8c324ebbfdb260ed9f414c7d2e90 (patch)
tree498b0d7313fce4037e9f373019465cfb794439d4
parent35ff7a07d5d86e2c0e6f9ce83645d1d6f34fc33a (diff)
downloadsonarqube-fa9bb27d5dca8c324ebbfdb260ed9f414c7d2e90.tar.gz
sonarqube-fa9bb27d5dca8c324ebbfdb260ed9f414c7d2e90.zip
SONAR-5056 Improve characteristic search
-rw-r--r--sonar-server/src/main/java/org/sonar/server/rule/RuleRegistration.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/rule/RuleRegistration.java b/sonar-server/src/main/java/org/sonar/server/rule/RuleRegistration.java
index 852273d4009..8a6bf727407 100644
--- a/sonar-server/src/main/java/org/sonar/server/rule/RuleRegistration.java
+++ b/sonar-server/src/main/java/org/sonar/server/rule/RuleRegistration.java
@@ -538,6 +538,9 @@ public class RuleRegistration implements Startable {
@CheckForNull
private CharacteristicDto findCharacteristic(List<CharacteristicDto> characteristicDtos, RuleDefinitions.Rule ruleDef) {
final String key = ruleDef.characteristicKey();
+ if (key == null) {
+ return null;
+ }
CharacteristicDto characteristicDto = Iterables.find(characteristicDtos, new Predicate<CharacteristicDto>() {
@Override
public boolean apply(CharacteristicDto input) {
@@ -547,7 +550,8 @@ public class RuleRegistration implements Startable {
}, null);
// TODO check not root characteristic
if (characteristicDto == null) {
- LOG.warn(String.format("Characteristic : '%s' has not been found, Technical debt definitions on rule '%s:%s' will be ignored", key, ruleDef.repository(), ruleDef.key()));
+ LOG.warn(String.format("Characteristic : '%s' has not been found, Technical debt definitions on rule '%s:%s' will be ignored", key,
+ ruleDef.repository().name(), ruleDef.key()));
}
return characteristicDto;
}