RuleSet implements ChecksumAware { @Deprecated public boolean usesDFA(Language language) { for (Rule r : rules) { if (r.getLanguage().equals(language) && r.isDfa()) { return true; } } return false; } private  RuleSet(final RuleSetBuilder builder);  RuleSet(final RuleSet rs); @Deprecated List<String> getExcludePatterns(); int size(); Collection<Rule> getRules(); Rule getRuleByName(String ruleName); boolean applies(File file); void start(RuleContext ctx); void apply(List<? extends Node> acuList, RuleContext ctx); static boolean applies(Rule rule, LanguageVersion languageVersion); void end(RuleContext ctx); @Override boolean equals(Object o); @Override int hashCode(); String getFileName(); String getName(); String getDescription(); @Deprecated List<String> getIncludePatterns(); List<Pattern> getFileExclusions(); List<Pattern> getFileInclusions(); @Deprecated boolean usesDFA(Language language); @Deprecated boolean usesTypeResolution(Language language); @Deprecated boolean usesMultifile(Language language); void removeDysfunctionalRules(Collection<Rule> collector); @Override long getChecksum();  }
@Test public void testNoDFA() { MockRule mock = new MockRule("name", "desc", "msg", "rulesetname"); mock.setLanguage(LanguageRegistry.getLanguage(DummyLanguageModule.NAME)); RuleSet rs = RulesetsFactoryUtils.defaultFactory().createSingleRuleRuleSet(mock); assertFalse(rs.usesDFA(LanguageRegistry.getLanguage(DummyLanguageModule.NAME))); }
@Test public void testIncludesRuleWithDFA() { MockRule mock = new MockRule("name", "desc", "msg", "rulesetname"); mock.setLanguage(LanguageRegistry.getLanguage(DummyLanguageModule.NAME)); mock.setDfa(true); RuleSet rs = RulesetsFactoryUtils.defaultFactory().createSingleRuleRuleSet(mock); assertTrue(rs.usesDFA(LanguageRegistry.getLanguage(DummyLanguageModule.NAME))); }