#314 Ignore Method/Javadoc on Strict duplicate check

open
nobody
Check (274)
5
2012-10-10
2004-08-18
Channing Walton
No

Hi,
I would find it useful to be able to ignore methods in
the strict duplicate check. My problem is standard EJB
methods which have to be duplicated.

Similarly, we use xdoclet to generate EJBs which has
duplicate sections for primary key definitions. Being
able to ignore javadoc in certain files would solve this.

Being able to define a suppression filter like this
would do it:

<suppress checks="StrictDuplicateCode" files="*EJB.java" method="setEntityContext,unsetEntityContext,..." javadoc="yes" meaning="" suppress="" duplicate="" checks="" in="" javadoc=""/>

Discussion

  • Lars Kühne
    Lars Kühne
    2004-08-18

    Logged In: YES
    user_id=401384

    What you suggest is very difficult to implement because the
    StrictDuplicateCode check has no information about the Java
    syntax tree, so it doesn't know where comments start or
    which methods the duplicates belong to.

    That is both a problem (for you) and a feature: It is
    possible to check more than just Java code. For example
    StrictDuplicateCode allows you to check C++ or Python code,
    or even txt files for duplicates.

    Maybe a solution to your problem would be to exclude the
    autogenerated code from the checkstyle inspection
    completely? At work we create autogenerated code in a
    different directory and only apply checkstyle to the source
    tree that contains handwritten code...

     
  • Logged In: YES
    user_id=32730

    Hi,
    thanks for the follow up.

    We also do not check the autogenerated code. What I was
    referring to was the EJB classes which have xdoclet code in
    the class comments - some of which is identical across all EJBs.

    Perhaps we need to look t Simian?

     
  • Logged In: YES
    user_id=32730

    Maybe a solution to your problem would be to exclude the
    autogenerated code from the checkstyle inspection

    Yup, that'll do it for us. (Sorry for the delay in getting
    back).

    Channing