#577 JavadocPackage cannot handle split packages

closed
nobody
None
5
2012-10-10
2009-06-21
Baron Roberts
No

I separate my unit test source code from my production source code by placing them in separate top level directories. However, to allow testing package level classes and methods, I use the same package for the production source and unit tests. Unfortunately, this confuses the JavadocPackage check. The check flags the package containing the unit tests as not having a package-info.java even though the production source package does contain one. If I add a package-info.java to the unit test package, an error occurs indicating that there is already a package-info.java.

Discussion

  • Oliver Burn
    Oliver Burn
    2010-03-09

    I recommend using a suppression to ignore Javadoc errors reported on unit test source code. Alternatively, run Checkstyle twice with different configurations for you production source code and unit test code.

    Either approach makes more sense. As such I am closing this as it is not a bug IMHO. If you are determined Checkstyle should support this, please raise a Feature Request, and be sure to supply a patch ;-)