Affects PMD Version: 7.15.0
Rule: FieldDeclarationsShouldBeAtStart
Description: Apex property declarations using accessor syntax ({ get; set; }) are not recognized as field declarations by this rule.
As a result, subsequent field declarations are incorrectly reported as violating the rule, even though the property is a valid field declaration in Apex.
Code Sample demonstrating the issue:
public class MyClass {
public String var1 { get; set; }
public String var2;
}
Expected outcome:
PMD reports a violation at line 3, but that's wrong. That's a false positive. var1 is a valid field declaration despite using property accessor syntax.
Running PMD through: Apex PMD vscode extension
Affects PMD Version: 7.15.0
Rule: FieldDeclarationsShouldBeAtStart
Description: Apex property declarations using accessor syntax (
{ get; set; }) are not recognized as field declarations by this rule.As a result, subsequent field declarations are incorrectly reported as violating the rule, even though the property is a valid field declaration in Apex.
Code Sample demonstrating the issue:
Expected outcome:
PMD reports a violation at line 3, but that's wrong. That's a false positive.
var1is a valid field declaration despite using property accessor syntax.Running PMD through: Apex PMD vscode extension