diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleBuilder.java b/pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleBuilder.java index 68706306c7..99063e45ca 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleBuilder.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleBuilder.java @@ -197,9 +197,15 @@ import net.sourceforge.pmd.properties.PropertyDescriptor; rule.addExample(example); } - rule.setDfa(isUsesDfa); - rule.setMultifile(isUsesMultifile); - rule.setTypeResolution(isUsesTyperesolution); + if (isUsesDfa) { + rule.setDfa(isUsesDfa); + } + if (isUsesMultifile) { + rule.setMultifile(isUsesMultifile); + } + if (isUsesTyperesolution) { + rule.setTypeResolution(isUsesTyperesolution); + } for (PropertyDescriptor descriptor : definedProperties) { if (!rule.getPropertyDescriptors().contains(descriptor)) {