Error: Extra bytes at the end of class file
Brought to you by:
tanmaykm
I simply tested ClassEditor by editing a class,
modified nothing at all.Clicked on save. tried to run
the applet, and get the error:
"java.lang.ClassFormatError: Extra bytes at the end of
class file"
i checked the file size before and after saving
(remember, i did not modification whatsoever): the
newly saved file is 2 bytes larger.. why?
Logged In: NO
forgot to mention the version number of the program:
ClassEditor 2.23
The extra bytes are a bug in the Inner Classes attribute number of classes field. I fixed it by editing src/classfile/attributes/InnerClassesAttribute.java on line 60 to be "writeShort" instead of "writeInt".