missing the code parts ? sorry .... ok I try again ---------------------------------------------------- // this part read from a resource so simplifying String className = 'java.awt.Canvas' String originalMethodName = 'repaint' String newMethName = 'repeindre' Class clazz = Class.forName(className) // now I want Canvas#repaint aliased as 'repeindre' clazz.metaClass."$newMethName" = { it== null? delegate."$originalMethName"() :delegate."$originalMethName"(*it)} -------------------------------------------------------------------------
now the aliasing expression does not work properly is there something simple or do I have to explore all the different cases for the method argument? for example this does not work: ----------------------------------------------------- clazz.metaClass."$newMethName" = clazz.metaClass.&"$originalMethName" ------------------------------------------------------ thanks ----- member of Grumpy Old Programmers -- View this message in context: http://groovy.329449.n5.nabble.com/aliasing-methods-tp5732316p5732335.html Sent from the Groovy Users mailing list archive at Nabble.com.