public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: frysk@sourceware.org
Subject: Patch for PR 5809
Date: Wed, 05 Mar 2008 13:51:00 -0000	[thread overview]
Message-ID: <18382.38977.407225.695512@fleche.redhat.com> (raw)

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  <tromey@redhat.com>

	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]

             reply	other threads:[~2008-03-05 13:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 13:51 Tom Tromey [this message]
2008-03-05 18:14 ` Mark Wielaard
2008-03-10 10:16   ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18382.38977.407225.695512@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).