Description
The following code worked in 2.5.12, in 2.5.13 testChildClass fails with groovy.lang.MissingPropertyException: No such property: PATTERNS for class: Child
emilles probably related to the changes mentioned here GROOVY-9665
class Example { @Test void testBaseClass() { new Base().check("FooSpec") } @Test void testChildClass() { new Child().check("FooSpec") } } class Base { private static final List<Pattern> PATTERNS = [~/.*Test/, ~/.*Spec/] def check(String str) { List failures = [] def result = PATTERNS.findResult { Pattern pattern -> if (pattern.matcher(str).matches()) { return str } else { failures.add("Pattern ${PATTERNS.indexOf(pattern)} did not match") } } if (!result) { throw new IllegalArgumentException("Did Match no pattern: "+failures.join(", ")) } return result } } class Child extends Base { }
Attachments
Issue Links
- is cloned by
-
GROOVY-9759 CLONE - Regression for accessing private static constants in closures from Map
-
- Closed
-
- is related to
-
GROOVY-9699 @CompileStatic does not use bridge methods for keyed map access
-
- Closed
-