On 24.04.25 23:06, James Daugherty wrote:
[...]
I'm planning to continue researching this, but if anyone has experience
with the AST transforms or the ordering problem, it would be helpful to
solve this. This is probably the largest blocker to us proceeding with an
ASF release.
as for the ordering. Groovy wants in general to use the order of
declaration in the source code. What we are talking about are most
likely methods added by transforms. And if it is one time stable and one
time not, then I guess Maps are involved. ClassNode has several
getDeclaredMethodsXY methods, which are based on a methods maps, while
getMethods or getMethodsList is based on the methods list.
If you then have something like
classNode.getAllDeclaredMethods().findAll(it annnotated with XY).each
{doSomethingWith(it)}
and there is more than one method annotated, then the order might be
broken between builds. Just to give one example.
I would suggest to go through all transforms and check on the usage of
the getDeclaredMethods methods and then avoid them to use for iteration.
They are ok for lookup of course.
bye Jochen