Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.1
-
None
Description
Hi I want to extend my list with new method and cache the result because actually it will query db but I am getting 'java.lang.UnsupportedOperationException', I reproduced it for simple case also using groovy console
def lst = [] lst.metaClass.getTotalCount = { println ">>>>>>>>>> 12 <<<<<<<<<<" 12 // can be some select count(*) from xxx }.memoize() println lst.getTotalCount() println lst.getTotalCount()
I am getting
java.lang.UnsupportedOperationException: org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod$AnonymousMetaMethod at ConsoleScript10.run(ConsoleScript10:2)
Attachments
Issue Links
- links to