A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1785 below:

[core] Allow abstract node types to be valid rulechain visits · Issue #1785 · pmd/pmd · GitHub

Rulechain visits are for now entirely handled as strings:

private List<String> ruleChainVisits = new ArrayList<>();

The implementation also throws an exception (!) if the node class doesn't have a hardcoded "AST" prefix:

public void addRuleChainVisit(Class<? extends Node> nodeClass) { if (!nodeClass.getSimpleName().startsWith("AST")) { throw new IllegalArgumentException("Node class does not start with 'AST' prefix: " + nodeClass); } addRuleChainVisit(nodeClass.getSimpleName().substring("AST".length())); }

Introducing some abstractions into the AST (like done in #1759, argumented on the wiki) has a number of advantages, but the current rulechain implementation doesn't scale. Adding a rulechain visit to an abstract node type currently does nothing, instead of visiting all nodes having the specified supertype.

Refs #1772

There's the exact same problem with XPath queries, which I'll explain in another issue


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4