DebuggerContext ctx = DebuggerContextManager.getDefault();
if (ctx == null) {
return Services.getMessage("debugging.session.absent");
}
ThreadContext threadCtx = ctx.getThreadContext();
String threadIdStr = commandLine.getValue(Options.THREAD_ID_OPTION);
long threadId;
if (threadIdStr == null) {
ctx.resume();
return Services.getMessage("debugging.session.resumed");
} else {
// Select the currently stepping thread if an empty thread ID is given.
if (threadIdStr.isEmpty()) {
IJavaThread steppingThread = (IJavaThread) threadCtx.getSteppingThread();
if (steppingThread != null) {
threadId = steppingThread.getThreadObject().getUniqueId();
} else {
return Services.getMessage("debugging.resume.thread.absent");
}
} else {
threadId = Long.parseLong(threadIdStr);
}
if (logger.isDebugEnabled()) {
logger.debug("Resuming thread ID: " + threadId);
}
threadCtx.resume(threadId);
return Services.getMessage("debugging.thread.resumed");
}
}