[jboss-jira] [JBoss JIRA] Commented: (JASSIST-43) ConstPool.getItem(int) returns unexpected item, causes exceptions in calling methods; e.g. in getFieldrefClassName(...) and getInterfaceMethodrefClassName(...)

Martin Burger (JIRA) jira-events at lists.jboss.org
Fri Jan 23 16:06:44 EST 2009


    [ https://jira.jboss.org/jira/browse/JASSIST-43?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12449540#action_12449540 ] 

Martin Burger commented on JASSIST-43:
--------------------------------------

I cannot reproduce this anymore. I suggest you close this issue (Cannot Reproduce Bug).

> ConstPool.getItem(int) returns unexpected item, causes exceptions in calling methods; e.g. in getFieldrefClassName(...) and getInterfaceMethodrefClassName(...)
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JASSIST-43
>                 URL: https://jira.jboss.org/jira/browse/JASSIST-43
>             Project: Javassist
>          Issue Type: Bug
>         Environment: $ uname -a
> Darwin [...] 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386
> $ java -version
> java version "1.5.0_13"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)
> Java HotSpot(TM) Client VM (build 1.5.0_13-121, mixed mode, sharing)
> Javassist 3.6.0
>            Reporter: Martin Burger
>            Assignee: Shigeru Chiba
>
> I am using subclasses of javassist.expr.ExprEditor to heavily instrument classes. On some large (in terms of amount of code) classes I get various exceptions in ConstPool, for example:
> Caused by: java.lang.ClassCastException: javassist.bytecode.ClassInfo
>         at javassist.bytecode.ConstPool.getFieldrefClassName(ConstPool.java:254)
>         at javassist.expr.FieldAccess.getClassName(FieldAccess.java:97)
>         at javassist.expr.FieldAccess.getCtClass(FieldAccess.java:89)
>         at javassist.expr.FieldAccess.getField(FieldAccess.java:112)
> And:
> Caused by: java.lang.NullPointerException
>         at javassist.bytecode.ConstPool.getInterfaceMethodrefClassName(ConstPool.java:413)
>         at javassist.expr.MethodCall.getClassName(MethodCall.java:91)
>         at javassist.expr.MethodCall.getCtClass(MethodCall.java:75)
>         at javassist.expr.MethodCall.getMethod(MethodCall.java:114)
> It seems that ConstPool.getItem(int) returns an "unexpected" item, so (1) the cast to FieldrefInfo fails and (2) the returned item is null instead of an instance of InterfaceMethodrefInfo, respectively.

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

        



More information about the jboss-jira mailing list