CodeNarc/CodeNarc — pull request #69 by MaciejZiarko (2014-11-09 17:47:42+00:00)
Title: PrivateFieldCouldBeFinalRule support for JPA entities

PrivateFieldCouldBeFinalRule is often not desirable for fields defined in entity classes. I added new property "ignoreJpaEntities" to aforementioned rule. When the property is set to true, fields inside classes annotated with @Entity or @MappedSupperclass are ignored.
I observed that PrivateFieldCouldBeFinalRule violations often happen in entity classes and at the same time I don't want to disable PrivateFieldCouldBeFinalRule fully. I just want it to be configurable to ignore JPA entities.

I also added new method boolean hasAnyAnnotation(AnnotatedNode node, String... names) to AstUtil.
Everything is tested.