return new SMInputFactory(xmlFactory);
}
- private DefaultCharacteristic processCharacteristic(DefaultTechnicalDebtModel model, DefaultCharacteristic parent, SMInputCursor chcCursor, ValidationMessages messages) throws XMLStreamException {
+ private DefaultCharacteristic processCharacteristic(DefaultTechnicalDebtModel model, DefaultCharacteristic parent, SMInputCursor chcCursor,
+ ValidationMessages messages) throws XMLStreamException {
DefaultCharacteristic characteristic = new DefaultCharacteristic();
SMInputCursor cursor = chcCursor.childElementCursor();
while (cursor.getNext() != null) {
private CharacteristicDto findCharacteristic(List<CharacteristicDto> characteristicDtos, RuleDefinitions.Rule ruleDef) {
final String key = ruleDef.characteristicKey();
if (key == null) {
+ // Rule is not linked to a characteristic, nothing to do
return null;
}
CharacteristicDto characteristicDto = Iterables.find(characteristicDtos, new Predicate<CharacteristicDto>() {
@Override
public boolean apply(CharacteristicDto input) {
+ String characteristicKey = input.getKey();
// TODO remove check on null rule id when only characteristics without requirements will be returned
- return input.getRuleId() == null && input.getKey().equals(key);
+ return input.getRuleId() == null && characteristicKey != null && characteristicKey.equals(key);
}
}, null);
// TODO check not root characteristic