Detect missing annotation given other clues in the definition of a method.

Help
2014-05-13
2014-05-18
  • Hi,

    I would like to know if it is possible to write a Findbugs custom detector which detects whether an annotation is missing on the basis of other clues in the method's definition.

    For instance, would it be possible to detect that everytime a method has a parameter of type 'BindingResult' or has an annotation of type '@ModelAttribute' then an annotation @Valid should be there too.

    Many thanks for your help,

    Frederic

     
    • Yes,

      this is possible and should be pretty straightforward.

      On Tue, 13 May 2014 17:36:52 +0200, frederic laurens flaurens@users.sf.net wrote:

      Hi,

      I would like to know if it is possible to write a Findbugs custom detector which detects whether an annotation is missing on the basis of other clues in the method's definition.

      For instance, would it be possible to detect that everytime a method has a parameter of type 'BindingResult' or has an annotation of type '@ModelAttribute' then an annotation @Valid should be there too.

      Many thanks for your help,

      Frederic


      Detect missing annotation given other clues in the definition of a method.


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/findbugs/discussion/334433/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

      --
      Kind regards,
      google.com/+AndreyLoskutov