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

Deleting all instructions of a list shows wrong behaviour

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: Main
    • Labels:
      None

      Description

      Deleting all instructions (i.e. everything from start to end) in a list shows
      the following behaviour:

      The length of the list is not 0 afterwards.
      Only the handle of the first instruction is disposed.

      To fix the problem, apply the following patch:

      Index: InstructionList.java
      ===================================================================
      — InstructionList.java (revision 592025)
      +++ InstructionList.java (working copy)
      @@ -677,8 +677,9 @@
      private void remove( InstructionHandle prev, InstructionHandle next )
      throws TargetLostException {
      InstructionHandle first, last; // First and last deleted instruction

      • if ((prev == null) && (next == null)) { // singleton list
      • first = last = start;
        + if ((prev == null) && (next == null)) { + first = start; + last = end; start = end = null; }

        else {
        if (prev == null) { // At start of list

        Attachments

          Activity

            People

            • Assignee:
              issues@commons.apache.org Apache Commons Developers
              Reporter:
              markus.gaisbauer@gmail.com Markus Gaisbauer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: