I have a method which returns a value that is generated in another method similar to this:
public static FileChannel open()
{
return provider.newObject();
}
So the bytecode of the method roughly looks like this:
INVOKEVIRTUAL org/test/Helper.process ()Lorg/test/MyObject;
ARETURN
I have a Java Agent which uses ASM to do bytecode-transformation when the JVM starts up.
Now I would like to inject code which access the returned MyObject without doing too much changes to the invoke itself, i.e. ideally I would just add some bytecode instructions before the ARETURN.
Which ASM/bytecode construct allows me to access the object that is returned here?