Affects PMD Version:
6.46.0
Rule:
ImmutableField
https://pmd.github.io/pmd-6.46.0/pmd_rules_java_design.html#immutablefield
Description:
Fields annotated with Selenium's @findby or @FindBys are reported as "could be final", but they must not be final in order to be set by reflection.
Code Sample demonstrating the issue:
public class SomePage {
@org.openqa.selenium.support.FindBy(id = "id1")
private WebElement field1;
@org.openqa.selenium.support.FindBys(value = {@org.openqa.selenium.support.FindByFindBy(id = "id2"),
@org.openqa.selenium.support.FindBy(xpath = "//div/table")})
private WebElement table;
}
Expected outcome:
PMD reports a violation for fields field1 and table but that's wrong. That's a false positive.
Running PMD through:
Eclipse
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