Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.7
-
None
-
None
Description
Consider the following:
PropertyBased.java
public class PropertyBased { protected final Object getProperty(String name) { return null; } protected final void setProperty(String name, Object value) { } }
Whatever.groovy
@groovy.transform.CompileStatic class Whatever extends PropertyBased { def getSomething() { 'some thing' } }
No compiler errors are produced for Whatever having protected "implementations" of GroovyObject methods. In this case, our legacy Java base class has getProperty for non-Groovy reasons. However, when accessing Whatever from dynamic Groovy code, IllegalAccessError is thrown. See the attached (run gradlew test)