[jboss-jira] [JBoss JIRA] Created: (JASSIST-37) CtField.getConstantValue() for just added fileds

Vlad Skarzhevskyy (JIRA) jira-events at lists.jboss.org
Thu Oct 11 16:46:03 EDT 2007


CtField.getConstantValue() for just added fileds
------------------------------------------------

                 Key: JASSIST-37
                 URL: http://jira.jboss.com/jira/browse/JASSIST-37
             Project: Javassist
          Issue Type: Bug
         Environment: Java 5, javassist 3.4.ga
            Reporter: Vlad Skarzhevskyy
         Assigned To: Shigeru Chiba


I'm creating tool to verify Java API compatibility

I'm converting  class files to XML and then XML to classes creating CtClass objects that have empty implementation.

Then target is to compare new lib version to API described in XML.

project site: http://pyx4me.com/snapshot/jour/signature.html

This is what causing the problem:

CtField field =  new CtField(CtClass.longType, "test", klass);
CtField.Initializer initializer = CtField.Initializer.constant(1);
klass.addField(field, initializer);

// Then later when
Object value = fields.getConstantValue();
//value is always null and can't be used for comparison.

when I  call klass.writeFile(); The .class is created correctly and when decompiled I see that int filed is properly initialized .





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list