Recaf
Recaf copied to clipboard
Creating new class methods behaves wierdly
Open a .jar file, and then open a class within that jar. Edit the assembly for a new method. Try to create a new method, by prepending:
.method .private test ()V
A:
aload this
pop
return
.end
This will give an error: Cannot resolve usage of 'this' to end label!
Now do the same, but postpend the method.
It "works" to save the assembly.
Close the assembly.
Now inspect the decompilation of that class, and try to find that method... It will not be there. Now open the assembly again: The newly created method has vanished into nothingness.
Okay, so this might be partly also my fault: If I use this code instead:
.method .private test ()V
A:
aload this
pop
return
B:
.end
It does seem to work as intended.
But I still believe that saving shouldn't quietly fail like this.
Closing as this has since been resolved in 4.X