Class Writer should thrown exception if method size is greater than 64kb limit
The ClassWriter.toByteArray() method should throw an exception if it sees that
the method size of any method is greater than the 64k limit of the jvm.
Here is a proposed modification to that method:
while (mb != null)
{
++nbMethods;
int methodSize = mb.getSize();
if (methodSize > 65535 )
{
throw new MethodSizeTooLargeException("<info about method");
}
size += methodSize;
mb = (MethodWriter) mb.mv;
}
class MethodSizeTooLargeException extends RuntimeException{
public MethodSizeTooLargeException(String msg){
super(msg);
}
}