You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2016/06/22 06:39:57 UTC

[jira] [Comment Edited] (BCEL-262) FieldOrMethod.getClassName(ConstantPoolGen cpg) is deprecated

    [ https://issues.apache.org/jira/browse/BCEL-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15088142#comment-15088142 ] 

Benedikt Ritter edited comment on BCEL-262 at 6/22/16 6:39 AM:
---------------------------------------------------------------

It's even more awkward - you must use:

{{invoke.getReferenceType(cp).getClass().getName();}}

Does the need to deprecated the original method even matter any more?  Who cares if Java5 generates bad code?


was (Author: markro):
It's even more awkward - you must use:

invoke.getReferenceType(cp).getClass().getName();

Does the need to deprecated the original method even matter any more?  Who cares if Java5 generates bad code?

> FieldOrMethod.getClassName(ConstantPoolGen cpg) is deprecated
> -------------------------------------------------------------
>
>                 Key: BCEL-262
>                 URL: https://issues.apache.org/jira/browse/BCEL-262
>             Project: Commons BCEL
>          Issue Type: Bug
>            Reporter: Sebb
>
> The method FieldOrMethod.getClassName(ConstantPoolGen cpg) is deprecated because it can return java.lang.Object for arrays.
> Now the method is defined in the superclass for FieldInstructions and InvokeInstructions.
> In the case of InvokeInstructions, can these ever reference an Array?
> If not, then the method could be overridden in the InvokeInstruction class.
> This new method would throw an unchecked Exception if detects an Array.
> This would change the behaviour of the method for subclasses of InvokeInstruction, but they would not need to be updated.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)