diff options
author | Mark Wielaard <mark@klomp.org> | 2006-12-04 21:38:46 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2006-12-04 21:38:46 +0000 |
commit | 35d51709830ba357880822156027d94c58b6a633 (patch) | |
tree | 4ad8dc4b476242af0db0ebabffa928f704b63623 | |
parent | 0e00e3d3548bb4c17c8a7ccfd32025923c87735a (diff) | |
download | classpath-35d51709830ba357880822156027d94c58b6a633.tar.gz |
2006-12-04 Robert Lougher <rob.lougher@gmail.com>
* java/lang/management/ThreadInfo.java (ThreadInfo): Check
whether given a null lock and lockOwner.
(getLockName): Switch condition.
(getLockOwnerId): Likewise.
(getLockOwnerName): Likewise.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | java/lang/management/ThreadInfo.java | 16 |
2 files changed, 17 insertions, 7 deletions
@@ -1,3 +1,11 @@ +2006-12-04 Robert Lougher <rob.lougher@gmail.com> + + * java/lang/management/ThreadInfo.java (ThreadInfo): Check + whether given a null lock and lockOwner. + (getLockName): Switch condition. + (getLockOwnerId): Likewise. + (getLockOwnerName): Likewise. + 2006-12-03 Mark Wielaard <mark@klomp.org> * javax/swing/JEditorPane.java (PageLoader.in): Made a PageStream. diff --git a/java/lang/management/ThreadInfo.java b/java/lang/management/ThreadInfo.java index 4bf35a4cb..f3131715b 100644 --- a/java/lang/management/ThreadInfo.java +++ b/java/lang/management/ThreadInfo.java @@ -200,10 +200,12 @@ public class ThreadInfo long waitedTime, boolean isInNative, boolean isSuspended, StackTraceElement[] trace) { - this(thread.getId(), thread.getName(), thread.getState(), blockedCount, - blockedTime, lock.getClass().getName() + "@" + - Integer.toHexString(System.identityHashCode(lock)), lockOwner.getId(), - lockOwner.getName(), waitedCount, waitedTime, isInNative, isSuspended, + this(thread.getId(), thread.getName(), thread.getState(), blockedCount, blockedTime, + lock == null ? null : lock.getClass().getName() + "@" + + Integer.toHexString(System.identityHashCode(lock)), + lockOwner == null ? -1 : lockOwner.getId(), + lockOwner == null ? null : lockOwner.getName(), + waitedCount, waitedTime, isInNative, isSuspended, trace); } @@ -484,7 +486,7 @@ public class ThreadInfo */ public String getLockName() { - if (threadState.equals("BLOCKED")) + if (!threadState.equals("BLOCKED")) return null; return lockName; } @@ -502,7 +504,7 @@ public class ThreadInfo */ public long getLockOwnerId() { - if (threadState.equals("BLOCKED")) + if (!threadState.equals("BLOCKED")) return -1; return lockOwnerId; } @@ -520,7 +522,7 @@ public class ThreadInfo */ public String getLockOwnerName() { - if (threadState.equals("BLOCKED")) + if (!threadState.equals("BLOCKED")) return null; return lockOwnerName; } |