commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Roberts (JIRA)" <>
Subject [jira] [Commented] (BCEL-262) FieldOrMethod.getClassName(ConstantPoolGen cpg) is deprecated
Date Thu, 07 Jan 2016 20:20:39 GMT


Mark Roberts commented on BCEL-262:

InvokeInstructions can most certainly reference an array.  As an example, here is a snippet
from com/sun/beans/editors/

public class EnumEditor implements PropertyEditor {
   private final String[] tags;
  public String[] getTags() {
        return this.tags.clone();

I claim the recent getClassName() override added to InvokeInstruction is incorrect.  I think
I can work around it by changing all calls to




But this seems pretty awkward.

> FieldOrMethod.getClassName(ConstantPoolGen cpg) is deprecated
> -------------------------------------------------------------
>                 Key: BCEL-262
>                 URL:
>             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

View raw message