summaryrefslogtreecommitdiff
path: root/jurt
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-04-01 15:27:52 +0100
committerAndras Timar <andras.timar@collabora.com>2016-06-12 22:54:14 +0200
commit39af786db06e8b754e857494dbcf5f5904ab064a (patch)
treee230d5ceb57e982e71657d04797884f02e64cb81 /jurt
parent6883f204cafe89e65d6d234ceca47dc5f94e6d95 (diff)
Java debugging agro.
(cherry picked from commit 964787c6b9cf834639298081b0168dd1593ee4e1)
Diffstat (limited to 'jurt')
-rw-r--r--jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java b/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java
index a25e31a9830c..5c52bc1bb33a 100644
--- a/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java
+++ b/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java
@@ -19,6 +19,7 @@
package com.sun.star.lib.uno.environments.remote;
import java.text.*;
+import java.util.*;
import com.sun.star.lang.DisposedException;
/**
@@ -85,6 +86,24 @@ public class JobQueue {
}
}
+ public static void printTrace()
+ {
+ Map<Thread, StackTraceElement[]> trace = Thread.getAllStackTraces();
+ Set<Thread> set = trace.keySet();
+ Iterator<Thread> i = set.iterator();
+ while(i.hasNext())
+ {
+ Thread key = i.next();
+ System.out.println("Trace information for the thread " + key);
+ StackTraceElement[] frames = trace.get(key);
+
+ for(int j = 0; j < frames.length; j++){
+ System.err.println(frames[j]);
+ }
+ System.err.println();
+ }
+ }
+
/**
* A thread for dispatching jobs.
*/
@@ -288,13 +307,16 @@ public class JobQueue {
int count = 0;
for (Job i = _head; i != null; i = i._next)
{
- if (i.isRequest())
+ if (!i.isRequest())
multipleReturns = true;
count++;
}
if (multipleReturns)
- printDebug("ERROR: MULTIPLE RETURNS");
+ {
+ printDebug("ERROR: MULTIPLE RETURNS.patch.2");
+ printTrace();
+ }
if(DEBUG) printDebug("##### " + getClass().getName() + ".putJob to queue of " + count);
printDebug("new job : " + job.toString());
for (Job i = _head; i != null; i = i._next)