From fa9bb27d5dca8c324ebbfdb260ed9f414c7d2e90 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 6 Mar 2014 20:20:02 +0100 Subject: SONAR-5056 Improve characteristic search --- .../src/main/java/org/sonar/server/rule/RuleRegistration.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 characteristicDtos, RuleDefinitions.Rule ruleDef) { final String key = ruleDef.characteristicKey(); + if (key == null) { + return null; + } CharacteristicDto characteristicDto = Iterables.find(characteristicDtos, new Predicate() { @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; } -- cgit v1.2.3