Replace
map.each { CachedClass cls, List<MetaMethod> methods ->
cls.setNewMopMethods(methods)
}
with
map.each { CachedClass cls, List<MetaMethod> methods ->
//Add new MOP methods instead of set them as new
cls.addNewMopMethods(methods)
}
When new meta method is set in the CachedClass
the existing extensions/meta methods are overriden by the only provided extension from the extension module. In this case, groovy-crypto-extension
uses the below extension methods on String class
class java.lang.String=
[public static javax.crypto.spec.SecretKeySpec ca.redtoad.groovy.extensions.crypto.CryptoExtensionMethods.toKey(java.lang.String),
public static javax.crypto.spec.SecretKeySpec ca.redtoad.groovy.extensions.crypto.CryptoExtensionMethods.toKey(java.lang.String,java.util.Map)
]
If those methods are set to the CachedClass, the existing methods are wiped out. So it has to be replace with adding them to the CachedClass. Hence, making toBoolean
available on String class.
Challenge accepted and executed. You owe me a treat. (Gift Card is acceptable too). ;)