From 08b018274c34fa1c82d9709cf1df01f21d5080fb Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 24 Nov 2017 20:45:13 +0100 Subject: [PATCH] [core] Fix rule loading - only override the flags, if they are true Avoid disabling type resolution --- .../java/net/sourceforge/pmd/rules/RuleBuilder.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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)) {