Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#183 Pkg name violation reported for every class in the pkg.

open
nobody
None
5
2012-10-10
2003-06-02
pbloemendaal
No

If the name of a package does not match the specified
regexp, a violation is generated for every class in the
package. Would be nicer if only 1 warning was
generated.

Discussion

  • Lars Kühne
    Lars Kühne
    2003-06-02

    Logged In: YES
    user_id=401384

    This request interferes with checkstyle's caching feature.
    Not reporting errors for files that actually have problems
    seems dangerous.

    Consider this scenario, with caching turned on:
    two classes A and B in package P that has an illegal package
    name. A is checked and reported. B is (according to the
    request) marked OK in the cache, since the illegal package
    name has already been reported so nothing is logged for B.
    After the check A is deleted.
    Expected result: wrong name P should be reported for B.
    Actual result: P is not reported for B since B is marked as
    OK in the cache.

    I wonder if it would be easier to handle this in a user
    written auditlistener (available in current CVS / release
    3.2) or XML filter.

     
  • pbloemendaal
    pbloemendaal
    2003-06-03

    Logged In: YES
    user_id=194131

    Isn't the type of check that is performed, compareable with
    the check for a package.html? A missing package.html is
    also reported only once (I assume).

     
  • Lars Kühne
    Lars Kühne
    2003-06-03

    Logged In: YES
    user_id=401384

    Good question, bu no, it's a little different because
    PackageHtml is a sibling of TreeWalker while PackageName is
    a submodule of TreeWalker. Caching is a feature of
    TreeWalker. The PackageHtml results are not cached, so
    PackageHtml is not affected by the problem below.

    Also note that the PackageHtml does not report en error for
    any java file but for the (non-existing) package.html.

     
  • Oliver Burn
    Oliver Burn
    2003-06-30

    Logged In: YES
    user_id=218824

    This is a request for new functionality, not a bug in the existing
    code. Hence, changed the type to a feature request.