groovy/groovy-core — pull request #569 by johnbhurst (2014-12-28 04:59:00+00:00)
Title: Fixes and tests for getting AST transforms relating to properties/fields to validate their includes/excludes lists.

I discussed this with Paul King and I believe I have implemented what we agreed.

The idea is that if there's a typo in a 'includes' or 'excludes' property list or the like, it should normally be a compile-time error. And consistent behavior should apply to all relevant AST transform annotations:
- AutoClone
- Canonical
- EqualsAndHashCode
- ExternalizeMethods
- ExternalizeVerifier
- Immutable
- Sortable
- ToString
- TupleConstructor

The current Groovy behavior ignores such errors, apart from @Sortable, which does check the 'includes' list but effectively not the 'excludes' list.

In case there is some code out there that relies on the current lack of error checking, I added a checkPropertyNames attribute to the annotations too. This is named for compatibility with checkPropertyTypes in @ExternalVerifier. The default is to enable property name checking, but the user can suppress this by setting checkPropertyNames=false. I cannot think of any scenario where one would want to do this. Even if one is generating properties dynamically, specifying a property name in 'includes' or 'excludes' that doesn't exist when the annotation is processed will skip the property anyway. It appears that those attributes can only be used for properties (or fields) that are available at compile time. If people agree that the checkPropertyNames attribute is not necessary, I would be happy to remove it.

Paul said that there might be one or two JIRA tickets open relating to the current behavior. I could not find them. Please let me know if there are tickets, and what is the correct way to relate this Pull Request to existing tickets.