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

Vlad Skarzhevskyy (JIRA) jira-events at lists.jboss.org
Fri Oct 12 12:55:03 EDT 2007


    [ http://jira.jboss.com/jira/browse/JASSIST-37?page=comments#action_12382206 ] 
            
Vlad Skarzhevskyy commented on JASSIST-37:
------------------------------------------

Now the only problem I see that there are no Initializer factory for boolean and float.


> 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 or  javassist 3.6.ga
>            Reporter: Vlad Skarzhevskyy
>         Assigned To: Shigeru Chiba
>         Attachments: AChildClass-generated.class
>
>
> 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 = field.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 .
> BUT When javassist  loads again the generated classes field.getConstantValue(); still null!

-- 
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