Remove rule factory singleton

This commit is contained in:
Clément Fournier
2017-10-16 13:22:50 +02:00
parent f98ac47045
commit b7caf2ff76
2 changed files with 5 additions and 5 deletions

View File

@ -526,7 +526,7 @@ public class RuleSetFactory {
&& !isRuleName(ruleElement, ruleSetReferenceId.getRuleName())) {
return;
}
Rule rule = RuleFactory.INSTANCE.buildRule(ruleElement);
Rule rule = new RuleFactory().buildRule(ruleElement);
rule.setRuleSetName(ruleSetBuilder.getName());
if (StringUtils.isNotBlank(ruleSetReferenceId.getRuleName())
@ -607,7 +607,7 @@ public class RuleSetFactory {
RuleSetReference ruleSetReference = new RuleSetReference(otherRuleSetReferenceId.getRuleSetFileName(), false);
RuleReference ruleReference = RuleFactory.INSTANCE.decorateRule(referencedRule, ruleElement);
RuleReference ruleReference = new RuleFactory().decorateRule(referencedRule, ruleElement);
ruleReference.setRuleSetReference(ruleSetReference);

View File

@ -35,8 +35,7 @@ import net.sourceforge.pmd.properties.PropertyDescriptorUtil;
*/
public class RuleFactory {
public static final RuleFactory INSTANCE = new RuleFactory();
private static final String DEPRECATED = "deprecated";
private static final String NAME = "name";
private static final String MESSAGE = "message";
@ -52,7 +51,8 @@ public class RuleFactory {
private static final String CLASS = "class";
private RuleFactory() {
/** Create a new rule factory. */
public RuleFactory() {
}