Menu

#1364 FieldDeclarationsShouldBeAtStartOfClass false positive using multiple annotations

PMD-5.3.3
closed
None
PMD
3-Major
Bug
5.3.2
FieldDeclarationsShouldBeAtStartOfClass
2015-05-31
2015-05-27
No

It seems to me that there is a similar bug related to issue [#1354].
The validation is successful when there is zero or one annotation, otherwise a false positive is displayed.

<test-code>
  <description>FieldDeclarationsShouldBeAtStartOfClass false positive using multiple annotations</description>
  <expected-problems>0</expected-problems>
  <code><![CDATA[
    public class MyEntity {

      private static final String MY_STRING = "STRING";

      @Id
      @Column
      private Long id;

      @NotNull
      @ManyToOne
      @JoinColumn
      @Valid
      private RelationEntity relation;

      public MyEntity() {
      }

   }
]]></code>
</test-code>

Related

Issues: #1331
Issues: #1354

Discussion

  • James Jamieson

    James Jamieson - 2015-05-29

    This is impacting us as well, all the single annotations are fine but a double annotation causes a false positive

     
  • Andreas Dangel

    Andreas Dangel - 2015-05-31
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.3.3
     

Log in to post a comment.