[jboss-user] [Javassist] - Javassist truncates big class file

David Iglesias do-not-reply at jboss.com
Mon Mar 21 12:09:08 EDT 2011


David Iglesias [http://community.jboss.org/people/dav.iglesias] created the discussion

"Javassist truncates big class file"

To view the discussion, visit: http://community.jboss.org/message/594522#594522

--------------------------------------------------------------
I have a problem with Javassist. When I try to edit a (relatively) big class file (38KB), Javassist will truncate it. It is the biggest class file I have tried editing, so I am asuming it has something to do with the size. Smaller class files have no problem.

The code I am running is this simple:


import javassist.*;
 
public class Test{
    public static void main(String[] args) throws Exception{
        ClassPool pool = ClassPool.getDefault();
        CtClass c = pool.get("com.ehsunbehravesh.mypasswords.gui.MainFrame");
        c.writeFile();
    }
}


And this is the result I get:


digles at XXXX:~/mypassbin/MyPasswords$ ls -l com/ehsunbehravesh/mypasswords/gui/MainFrame.class 
-rw-r--r-- 1 digles XXXX 38201 ene 31 13:53 com/ehsunbehravesh/mypasswords/gui/MainFrame.class
digles at XXXX:~/mypassbin/MyPasswords$ java Test 
digles at XXXX:~/mypassbin/MyPasswords$ ls -l com/ehsunbehravesh/mypasswords/gui/MainFrame.class 
-rw-r--r-- 1 digles XXXX 16384 mar 21 11:09 com/ehsunbehravesh/mypasswords/gui/MainFrame.class


Can anybody help me with this? Thanks in advance.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/594522#594522]

Start a new discussion in Javassist at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2062]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110321/8883d0a9/attachment.html 


More information about the jboss-user mailing list