Menu

#1399 False positive for VariableNamingConventions with annotation @interface

PMD-5.3.4
closed
None
PMD
3-Major
Bug
5.3.3
java-naming/VariableNamingConventions
2015-09-05
2015-09-02
Rei Angelus
No

As annotations are a form of interface, their fields are also automatically public, static and final just as their annotation fields are automatically public and abstract.

For this reason, I think the example below should not be positive.

        <test-code>
        <description>False positive for VariableNamingConventions with annotation @interface</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public @interface Relation {

    int NO_REVERSE_RELATION = -1;
}
        ]]></code>
    </test-code>

Thanks,

Discussion

  • Andreas Dangel

    Andreas Dangel - 2015-09-05
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -2,6 +2,7 @@
    
     For this reason, I think the example below should not be positive.
    
    +~~~~~
     ::: xml
    
             <test-code>
    @@ -14,5 +15,6 @@
     }
             ]]></code>
         </test-code>
    -    
    +~~~~~
    +
     Thanks,
    
     
  • Andreas Dangel

    Andreas Dangel - 2015-09-05
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,8 +3,7 @@
     For this reason, I think the example below should not be positive.
    
     ~~~~~
    -::: xml
    -
    +:::xml
             <test-code>
             <description>False positive for VariableNamingConventions with annotation @interface</description>
             <expected-problems>0</expected-problems>
    
     
  • Andreas Dangel

    Andreas Dangel - 2015-09-05
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.3.4
    • Ruleset / Rule: --> java-naming/VariableNamingConventions
     

Log in to post a comment.