[core] Fix rule loading - only override the flags, if they are true

Avoid disabling type resolution
This commit is contained in:
Andreas Dangel
2017-11-24 20:45:13 +01:00
parent b879e76d8b
commit 08b018274c

View File

@ -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)) {