Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#44 package.html issue

release_2.2
closed
Oliver Burn
1
2012-10-10
2002-05-16
Joan Roch
No

When "checkstyling" files from two different folder
trees, with the 'requirePackageHtml' option turned on,
CheckStyle "incorrectly" reports a
missing 'package.html' if the same package is
represented in both trees.

Ok, an example will help. Here is a simple tree:

src/com/sample/package.html
src/com/sample/SampleClass.java
src-junit/com/sample/TestSampleClass.java

As you can see, JUnit test cases are separated in a
distinct folder to make it even easier to exclude them
from the build if necessary... but
the 'TestSampleClass' is in the same 'com.sample'
package as 'SampleClass'. And this package already has
a 'package.html' file.

This is where CheckStyle "incorrectly" reports a
missing 'package.html'... I know, this is not really a
major problem... but I wanted to let you know!

Regards.

Discussion

  • Oliver Burn
    Oliver Burn
    2002-05-16

    Logged In: YES
    user_id=218824

    Thanks for raising this issue. I can understand the issue
    you are
    describing. This area is open to interpretation.

    In the example you have given, I would consider that you
    have two different
    source trees, being "src" and "src-junit". Hence, they
    should be checked with
    separate calls to the <checkstyle/> task with different
    options. The call for
    "src" would check for the package.html file. This is
    actually what I do now
    for similar directory structures. In fact, I checkstyle
    unit test code with
    very different options as I do not care for Javadoc on
    anything other than
    public declarations.

    I think that since the current behaviour of Checkstyle can
    be viewed as both
    desirable (by me) and undesirable (by you), that it is not
    possible to satisfy
    everyone. The workaround given the current implementation
    is to call
    <checkstyle> twice. Using <antcall> or the "properties"
    option in Checkstyle
    2.2 are techniques to reduce duplication.