Github user mgroovy commented on a diff in the pull request:
https://github.com/apache/groovy/pull/686#discussion_r182729445
--- Diff:
src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java ---
@@ -196,39 +322,10 @@ private boolean shouldTransform(DeclarationExpression
exp) {
}
private boolean hasClassesToNewify() {
- return classesToNewify != null &&
!classesToNewify.getExpressions().isEmpty();
+ return (classesToNewify != null &&
!classesToNewify.getExpressions().isEmpty()) || (classNamePattern != null); //
2018-04-07 TODO: Check if classNamePattern != null can be made more "early out"
--- End diff --
This TODO refers to e.g. an edge case optimization to defer the class name
Pattern compilation to the point where is actually accessed. I don't expect
this to make sense (also I am now checking against the class name pattern
before checking against the class name list, since I expect this to be faster
in practice), so I have not implemented it. Should probaly not be a TODO any
more, but at most a regular comment, I can change this and redo the PR if you
want.
---