Affects PMD Version: 6.18.0
Rule:
Description: if number of expected lines do not match to actual there will be exception with text java.lang.RuntimeException: Test setup error: number of execpted line numbers doesn't match number of violations for test case
The problem is
Code Sample demonstrating the issue:
Could be reproduced with any successful rule and with wrong expected-linenumbers
, e.g. test-code snippet based on rule pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml
<test-code>
<description>#1289 CommentRequired not ignored if javadoc {@inheritDoc} anon inner classes</description>
<expected-problems>0</expected-problems>
<expected-linenumbers>3</expected-linenumbers>
<code><![CDATA[
/**
* Comment required test class.
*/
public class CommentRequired {
/**
* Creates a new instance of comment required.
*/
public CommentRequired() {
Object o = new Object() {
/**
* {@inheritDoc}
*/
public String toString() {
return "Inner Class";
}
};
}
}
]]></code>
</test-code>
Running PMD through: Maven
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