Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ACD2011E8E for ; Thu, 24 Apr 2014 09:13:43 +0000 (UTC) Received: (qmail 21289 invoked by uid 500); 24 Apr 2014 09:13:27 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 21047 invoked by uid 500); 24 Apr 2014 09:13:19 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 20931 invoked by uid 99); 24 Apr 2014 09:13:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Apr 2014 09:13:16 +0000 Date: Thu, 24 Apr 2014 09:13:16 +0000 (UTC) From: "Emmanuel Bourg (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (BCEL-115) Deleting all instructions of a list shows wrong behaviour MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/BCEL-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Emmanuel Bourg updated BCEL-115: -------------------------------- Priority: Major Environment: (was: Operating System: other Platform: Other) Affects Version/s: (was: unspecified) Fix Version/s: 6.0 Priority: (was: P2) Severity: (was: normal) > Deleting all instructions of a list shows wrong behaviour > --------------------------------------------------------- > > Key: BCEL-115 > URL: https://issues.apache.org/jira/browse/BCEL-115 > Project: Commons BCEL > Issue Type: Bug > Components: Main > Reporter: Markus Gaisbauer > Assignee: Apache Commons Developers > Fix For: 6.0 > > > 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 -- This message was sent by Atlassian JIRA (v6.2#6252)