Describe the bug
When using a rule that has pmd-java:typeIs checks, the rules are working fine in the designer, however the exported rules are not working later on when testing the rules in Java unit tests.
The rule would look something like:
//PrimaryPrefix/Name[@Image[ends-with(., 'Instant.now')]][pmd-java:typeIs('java.time.Instant')]
and the example code:
package foo;
public class Hello {
public static void main(String[] args) {
java.time.Instant.now();
}
}
This file fails validation as expected in the designer, but when the rule is exported, the rule no longer works, and violation is no longer reported. After debugging TypeIsFunction, it turned out that this happened because the rule was not set up to perform typeResolution. Manually adding the typeResolution="true"
attribute to the rule definition appears to fix this problem.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Either the UI should run the queries with typeResolution disabled (and have a visible enable flag), or the export view should add the required attribute to the rule definition.
Screenshots
Let me know if you need one.
Desktop (please complete the following information):
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