Checkstyle fixes / enable suppressions

This commit is contained in:
Andreas Dangel
2016-11-20 15:05:15 +01:00
parent 4149d25018
commit 712f7ae06b
3 changed files with 7 additions and 7 deletions

View File

@ -83,10 +83,11 @@ public abstract class AbstractRuleChainVisitor implements RuleChainVisitor {
List<Node> ns = nodeNameToNodes.get(nodeNames.get(j));
for (Node node : ns) {
// Visit with underlying Rule, not the RuleReference
while (rule instanceof RuleReference) {
rule = ((RuleReference) rule).getRule();
Rule actualRule = rule;
while (actualRule instanceof RuleReference) {
actualRule = ((RuleReference) actualRule).getRule();
}
visit(rule, node, ctx);
visit(actualRule, node, ctx);
}
visits += ns.size();
}

View File

@ -257,16 +257,15 @@ public final class StringUtil {
char c;
int i = 0;
while (i < src.length()) {
c = src.charAt(i);
c = src.charAt(i++);
if (c > '~') {
// 126
if (!supportUTF8) {
int codepoint = c;
// surrogate characters are not allowed in XML
if (Character.isHighSurrogate(c)) {
char low = src.charAt(i + 1);
char low = src.charAt(i++);
codepoint = Character.toCodePoint(c, low);
i += 1;
}
buf.append("&#x").append(Integer.toHexString(codepoint)).append(';');
} else {
@ -283,7 +282,6 @@ public final class StringUtil {
} else {
buf.append(c);
}
i++;
}
}

View File

@ -606,6 +606,7 @@
</dependencies>
<configuration>
<configLocation>/net/sourceforge/pmd/pmd-checkstyle-config.xml</configLocation>
<suppressionsLocation>/net/sourceforge/pmd/pmd-checkstyle-suppressions.xml</suppressionsLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>