Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Trivial
-
Resolution: Fixed
-
Affects Version/s: 1.6.1
-
Fix Version/s: 1.7.2, 1.6.9, 1.8-beta-1
-
Component/s: class generator
-
Labels:None
-
Number of attachments :
Description
groovy.runtime.metaclass.MetaClassRegistryImpl checks for a custom class "groovy.runtime.metaclass.CustomMetaClassCreationHandle" which, if defined, allows the developer to override MetaClassRegistry.MetaClassCreationHandle with a custom class.
The custom class must subclass MetaClassCreationHandle, however the only method worth subclassing (create()) is declared as final, thus breaking this functionality.
In summary - groovy/lang/MetaClassRegistry.java line 116 - the method create() should not be final
I second that issue. For my current work i would love to construct a MetaClassCreationHandle which sort of decorates the default MetaClassCreationHandle, which - since the create method is final - is not possible. Alternatively overwriting createNormalMethod leads to my additional features beeing applied only to classes, which don't have a custom MetaClass declared, which is not the way we intended it to be.