I think the original code has bugs... The hardcoded `4` can not match any
valid ASM API version, so `IllegalArgumentException` will be thrown.
int ASM4 = 4 << 16 | 0 << 8;
int ASM5 = 5 << 16 | 0 << 8;
int ASM6 = 6 << 16 | 0 << 8;
int ASM7 = 7 << 16 | 0 << 8;
4 == ASM7 || 4 == ASM6 || 4 == ASM5
Thought it is buggy too but it fixes the issue - maybe throwing the
exception, I didnt check much.
Another weird line is the reader which uses a writer config (
https://github.com/groovy/groovy-core/blob/master/src/main/org/codehaus/groovy/runtime/callsite/GroovySunClassLoader.java#L69
).
In any
> Another weird line is the reader which uses a writer config
Yep. I tried to fix the bytecode issues in the past:
https://github.com/apache/groovy/pull/1103
But the PR was not accepted. Also, I have not much spare time to continue,
so leave it as it is...
Cheers,
Daniel.Sun
-
Apache