Your assessment appears correct.

PropertyExpression works like this:
    public Expression transformExpression(ExpressionTransformer transformer) {
        PropertyExpression ret = new 
PropertyExpression(transformer.transform(objectExpression), 
transformer.transform(property), safe);

PoppingMethodCallExpression works like this:
        public Expression transformExpression(final ExpressionTransformer 
transformer) {
            PoppingMethodCallExpression call = new 
PoppingMethodCallExpression(getObjectExpression().transformExpression(transformer),
 getMethodTarget(), (TemporaryVariableExpression) 
tmp.transformExpression(transformer));


There may be several instances of this to correct and test if all of the 
Expression sub-types are looked at.  I'd start by filing a new Jira ticket.


-----Original Message-----
From: Saravanan Palanichamy <chava...@gmail.com> 
Sent: Thursday, August 6, 2020 8:43 AM
To: dev@groovy.apache.org
Subject: StaticPropertyAccessHelper transforms are not routed through my 
expression transformer

Hello

My class derives from ClassCodeExpressionTransformer and I use it to transform 
my method call expression. Lets say I add an extra parameter to these methods. 
This works for normal expression, however for property setter expressions, this 
does not work because it does not route through my class

I root caused this to the StaticPropertyAccessHelper class which uses a 
PoppingMethodCallExpression. In this class, it does not call 
transformer.transform(receiver), instead it invokes 
receiver.transformExpression(transformer). This means code like this

myObj.property = myFunction() 

Where property is a setProperty() function will result in not routing through 
my transformer. Am I root causing this correctly or is my understanding wrong? 
What is the fix for this? I am using Groovy 2.5.x. Is this fixed in newer 
versions?

regards
Saravanan

Reply via email to