Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-262

InvokeInstruction.getClassName(ConstantPoolGen) should not throw an exception when it detects an array

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 6.0
    • None
    • None

    Description

      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.

      Attachments

        1. bug262.diff
          3 kB
          Mark Roberts
        2. InvokeInstruction.diff
          0.9 kB
          Mark Roberts

        Activity

          People

            britter Benedikt Ritter
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: