--- ThreadInfo.java 2006-07-09 21:02:03.000000000 +0100 +++ ThreadInfo.java-new 2006-12-03 19:21:01.000000000 +0000 @@ -200,10 +200,12 @@ 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 String getLockName() { - if (threadState.equals("BLOCKED")) + if (!threadState.equals("BLOCKED")) return null; return lockName; } @@ -502,7 +504,7 @@ */ public long getLockOwnerId() { - if (threadState.equals("BLOCKED")) + if (!threadState.equals("BLOCKED")) return -1; return lockOwnerId; } @@ -520,7 +522,7 @@ */ public String getLockOwnerName() { - if (threadState.equals("BLOCKED")) + if (!threadState.equals("BLOCKED")) return null; return lockOwnerName; }