| Some Java compilers initialize arrays using straight-line code. For
classes that have large, initialized arrays this results in unnecessarily
large classfiles. CompactArrayInitializer examines a method
(via its MethodEditor) creates a string in the method's
class's constant pool that contains all of the elements of the
initialized array. After the old initialization code is removed from the
method, new code is inserted that essentially is a loop that loads each
element from the string into the array. Note that only arrays of
int, short, char, byte,
and boolean are compacted.
Parameters: method - The method whose array initializations are to be compacted. |