From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31547 invoked by alias); 5 Mar 2008 13:51:37 -0000 Received: (qmail 31536 invoked by uid 22791); 5 Mar 2008 13:51:36 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 05 Mar 2008 13:51:14 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m25DpCqu027392 for ; Wed, 5 Mar 2008 08:51:12 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m25DpBow014729 for ; Wed, 5 Mar 2008 08:51:11 -0500 Received: from mopsy.redhat.com (vpn-248-60.boston.redhat.com [10.13.248.60]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m25Dp9XR010127; Wed, 5 Mar 2008 08:51:10 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18382.38977.407225.695512@fleche.redhat.com> Date: Wed, 05 Mar 2008 13:51:00 -0000 To: frysk@sourceware.org Subject: Patch for PR 5809 X-Mailer: VM 8.0.x-xemacs-522 under Emacs 22.1.1 (i386-redhat-linux-gnu) From: Tom Tromey Reply-To: Tom Tromey X-Attribution: Tom X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q1/txt/msg00125.txt.bz2 This fixes PR 5809. An earlier patch removed the Comparator, forgetting that that Map.Entry is not comparable. I'm a little surprised nobody caught this before. If you have a breakpoint and type "actions", you will get a stack trace. Tom 2008-03-05 Tom Tromey Bug 5809 * ActionPointCommands.java (Actions.interpret): Use Comparator to sort the task set. diff --git a/frysk-core/frysk/hpd/ActionPointCommands.java b/frysk-core/frysk/hpd/ActionPointCommands.java index 5fdaaf1..3c6c681 100644 --- a/frysk-core/frysk/hpd/ActionPointCommands.java +++ b/frysk-core/frysk/hpd/ActionPointCommands.java @@ -46,6 +46,7 @@ import frysk.rt.SourceBreakpoint; import frysk.rt.UpdatingDisplayValue; import java.util.List; import java.util.Arrays; +import java.util.Comparator; import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -213,7 +214,13 @@ abstract class ActionPointCommands extends ParameterizedCommand { Map.Entry[] taskEntries = new Map.Entry[taskEntrySet.size()]; taskEntrySet.toArray(taskEntries); - Arrays.sort(taskEntries); + Arrays.sort(taskEntries, new Comparator() { + public int compare(Object o1, Object o2) { + Map.Entry me1 = (Map.Entry) o1; + Map.Entry me2 = (Map.Entry) o2; + return ((Task) me1.getKey()).compareTo(me2.getKey()); + } + }); for (int i = 0; i < taskEntries.length; i++) { int id = ((Task) taskEntries[i].getKey()).getTid(); SourceBreakpoint.State state = (SourceBreakpoint.State) taskEntries[i]