#314 Ignore Method/Javadoc on Strict duplicate check

Check (274)

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=""/>


  • Lars Kühne

    Lars Kühne - 2004-08-18

    Logged In: YES

    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...

  • Channing Walton

    Channing Walton - 2004-08-18

    Logged In: YES

    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?

  • Channing Walton

    Channing Walton - 2004-10-27

    Logged In: YES

    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


  • Roman Ivanov

    Roman Ivanov - 2015-10-22
    • status: open --> closed
    • Group: --> Future
  • Roman Ivanov

    Roman Ivanov - 2015-10-22

    duplication module was removed from Checkstyle.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks