[ checkstyle-Bugs-3435783 ] Caching is "broken" when using Filters

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ checkstyle-Bugs-3435783 ] Caching is "broken" when using Filters

Bugs item #3435783, was opened at 2011-11-09 16:49
Message generated for change (Comment added) made by oburn
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core Framework
Group: SVN Head
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: https://www.google.com/accounts ()
>Assigned to: Nobody/Anonymous (nobody)
Summary: Caching is "broken" when using Filters

Initial Comment:
We have a rather large project with many maven modules and we use the maven-checkstyle-plugin in Maven's verfify phase to prevent developers from checking in unwanted code (so, checkstyle is more than a reporting tool for us).
In this scenario, we found checkstyle to consume ~25% of the build time. So we moved the cache-files to a location where maven does not clean them to gain as much effect form the caching as we can.
The problem is: This had almost no effect (1-3%)!

I found the reason while debugging maven-checkstyle-plugin 2.8 which uses checkstyle 2.4:
TreeWalker only calls PropertyCacheFile.checkedOk(...) - which eventually writes the java file name to the cache file - when no messages have been collected (line 254).

>From the perspective of TreeWalker this might be correct but Checker applies a FilterSet to those messages which might lead to no violation messages at all!
In fact, in our module which I chose for the debugging session which has only 10 classes or so, over 1000 (!) messages are collected but in the end SuppressionCommentFilter kicks in and none of the messages are "accepted". So everything is fine, but TreeWalker/PropertyCacheFile writes only one file to the cache file.
The next time the module is build, the whole story continues.

To make a long story short:
Checkstyle's caching feature needs to be aware of Checker's FilterSet in some way (e.g. move caching to Checker or register TreeWalker as some listener to clean up PropertyCacheFile etc.).

In the current state, the caching feature is useless for us and we have to live with this rather large performance penalty!

By the way: It seems rather inefficient to collect hundreds of potential violation messages just to reject them all in the end but I think this is for some reason I just don't know yet...


>Comment By: Oliver Burn (oburn)
Date: 2012-04-16 03:24

This is not a bug. The caching works as designed, and will only record
files that have successfully passed with no errors. This means that the
caching only records that a file has passed with no errors, and does not
try and keep track of any errors reported.

To keep track of the errors would be a feature enhancement.


Comment By: https://www.google.com/accounts ()
Date: 2011-11-10 01:10

Small typo:
maven-checkstyle-plugin 2.8 uses checkstyle 5.4, not 2.4!


You can respond by visiting:

For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
Checkstyle-devel mailing list
[hidden email]