Bug fix [ 1811828 ] RuntimeException in RuleSetFactory

At least the second part from the comments about the
ArrayIndexOutOfBoundsException is fixed by this change


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5604 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Xavier Le Vourch
2007-10-30 04:02:49 +00:00
parent eda9223e3c
commit df287f9dd5

View File

@ -185,8 +185,10 @@ class RuleSetWriterImpl implements IRuleSetWriter {
final Element descriptionElement = getDescriptionElement(doc, rule.getDescription());
ruleElement.appendChild(descriptionElement);
final Element exampleElement = getExampleElement(doc, rule.getExamples().get(0).toString());
ruleElement.appendChild(exampleElement);
if (rule.getExamples().size() > 0) {
final Element exampleElement = getExampleElement(doc, rule.getExamples().get(0).toString());
ruleElement.appendChild(exampleElement);
}
final Element priorityElement = getPriorityElement(doc, rule.getPriority());
ruleElement.appendChild(priorityElement);