Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.6.5, 1.7-beta-2
-
Fix Version/s: None
-
Component/s: class generator
-
Labels:None
-
Number of attachments :
Description
When generating code for the Groovy compiler, one frequently exceeds the Class file format limit on method size. The resulting ClassFormatError from the ClassLoader doesn't effectively point at the problem. In addition, the Error is not a type of Exception and so is not picked up by conventional logging.
Ideally, the methods that generate class files would abort code-generation and throw a type of Exception when the generated method exceeds the limit imposed by the class file format.
org.objectweb.asm.MethodWriter has this package-private method called getSize() that could have been used by ACG to validate the code length of the method it generates. But alas, ASM obfuscates it!