This came up before in relation to tomcat's jsp compiler generating large methods. I believe they now break up methods into smaller pieces to avoid the limitation. Regardless, I can't think of any good reason to have an 8500 line class!

David



From: Becky Norum <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [OT] Java method size limitations
Date: 05 Mar 2003 09:28:14 -0500

This is FYI - it was an issue that came up when someone (not me!) had an
8500 line Java source file.  He got a "code too large for try statement"
exception during compilation, which puzzled even some long term Java
programmers.

Apparently, there is an upper limit of 64K (compiled) on java methods.
(see
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#154)

The Java method bytecode code length is defined as an int (32-bit), but
exception start/end blocks are defined by shorts (16-bit).  This limits
the method length to 2^16=64K.

Hopefully, noone on this list will ever write a class that large, but in
case you ever run across this..

--
Becky Norum
Database Administrator
Center for Subsurface Sensing and Imaging Systems (CenSSIS)
Northeastern University
http://www.censsis.neu.edu



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to