Quickie: how to make Clover ignore private constructors in Eclipse
PDFHere’s a blatant repost of How to make Clover ignore private constructors by Alex Ruiz.
I was actually looking for a regular expression matching private constructors so that I could make Clover ignore these in the Eclipse plugin. His post is about how to configure Clover in Maven however, here’s how you configure the Eclipse plugin.
First the regular expression:
1 | (.* )?private +[a-zA-Z0-9_$]+ *( *).* |
Now to add this to Eclipse, unfortunately you need to configure the Clover settings on a project basis. Go to your project rightclick -> Clover -> Configure…. Then click Add under Custom Coverage Context Filters and fill in the form as seen below.
Hit OK and rebuild and test your project and voilà, your constructor is ignored.
Tags: atlassian • clover • eclipse • java