private synchronized void update(IPHPDebugTarget target) {
IPHPDebugTarget oldTarget = fTarget;
int oldcount = fUpdateCount;
fTarget = target;
HTMLDocumentLoader ss = new HTMLDocumentLoader();
BasicStructuredDocument dd = (BasicStructuredDocument) ss
.createNewStructuredDocument();
Object input = dd;
if (fTarget != null) {
if ((fTarget.isSuspended()) || (fTarget.isTerminated())
|| (fTarget.isWaiting())) {
DebugOutput outputBuffer = fTarget.getOutputBuffer();
fUpdateCount = outputBuffer.getUpdateCount();
// check if output hasn't been updated
if (fTarget == oldTarget && fUpdateCount == oldcount)
return;
String output = outputBuffer.toString();
dd.setText(this, output);
} else {
// Not Suspended or Terminated
// the following is a fix for bug
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=205688