public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Patch for PR 5809
@ 2008-03-05 13:51 Tom Tromey
  2008-03-05 18:14 ` Mark Wielaard
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2008-03-05 13:51 UTC (permalink / raw)
  To: frysk

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]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-10 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-05 13:51 Patch for PR 5809 Tom Tromey
2008-03-05 18:14 ` Mark Wielaard
2008-03-10 10:16   ` Mark Wielaard

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).