3 ms·
Instead of manipulating byte code at runtime, wouldn't it make more sense to use an annotation processor to just create a specialized UnsafeArrayList for each i
by RyanZAG 11y ago
Instead of manipulating byte code at runtime, wouldn't it make more sense to use an annotation processor to just create a specialized UnsafeArrayList for each input type you need?
With something like JavaPoet, it's fairly easy to do as well. It feels a lot safer than manually creating byte code like that. Let javac do that for you.
EDIT: If you're not familiar with JavaPoet, check it out here: https://corner.squareup.com/2015/01/javapoet.html https://corner.squareup.com/2015/01/javapoet.html