Personally I strongly prefer small methods. Reasonable people can disagree about when a method is too big, but when you get an error message like this, your method is too damn big.
java.lang.ClassFormatError: Invalid Method Code length <123456> in com/example/MyClass
That’s the JVM telling you that the method is larger than it can cope with it. 123456 is the size of the method bytecode in bytes.
Now I have not actually seen a method so long that the code alone triggered this error – it happened when we used PowerMock to mock a large class with large methods, then tried to use Cobertura to measure our test coverage.
The fix: breaking up the large methods. When you see this error, it’s time.