janino-compiler / janino

Janino is a super-small, super-fast Java™ compiler.
http://janino-compiler.github.io/janino
Other
1.21k stars 205 forks source link

Implement implicit conversions to Arrays with Annotations #189

Closed Geolykt closed 1 year ago

Geolykt commented 1 year ago

This allows to compile mods using sponge's Mixin framework without hell breaking loose.


More specifically @Inject(at = @At("HEAD"), method = "render()V") implicitly defines two arrays, so it is comparable to @Inject(at = {@At("HEAD")}, method = {"render()V"}). Before this commit janino used to ignore the fact that at and method were declared as arrays and would instead directly define the elements without wrapping them into an array prior, which is a big no-no

aunkrig commented 1 year ago

Hey Geolykt,

greetings from Munich to Hessia, and thank you for the excellent fix! I just merged it (manually); please re-test!

The icing on the cake would be if you'd write a nice org.codehaus.commons.compiler.tests.JlsTest.test_9_7_1__Normal_Annotations3() method that verifies whether the change is effective or not ;-) .

CU Arno

Geolykt commented 1 year ago

Hello,

Thanks for merging! I'll see what I can do about the tests, haven't really looked at whether the issue becomes visible outside of bytecode manipulation.