Source:
<code>private void handleSubmitError(SubmitJob job) { if (form != null && !form.isDisposed()) { final IStatus status = job.getStatus(); if (status.getCode() == RepositoryStatus.REPOSITORY_COMMENT_REQUIRED) { TasksUiInternal.displayStatus(Messages.AbstractTaskEditorPage_Comment_required, status); AbstractTaskEditorPart newCommentPart = getPart(ID_PART_NEW_COMMENT); if (newCommentPart != null) { newCommentPart.setFocus(); } } else if (status.getCode() == RepositoryStatus.ERROR_REPOSITORY_LOGIN) { if (TasksUiUtil.openEditRepositoryWizard(getTaskRepository()) == Window.OK) { submitEnabled = true; doSubmit(); } else { String message; if (status.getMessage().length() > 0) { if (status.getMessage().length() < 100) { message = Messages.AbstractTaskEditorPage_Submit_failed_ + status.getMessage(); } else { message = Messages.AbstractTaskEditorPage_Submit_failed_ + status.getMessage().substring(0, 100) + "..."; } } else { message = Messages.AbstractTaskEditorPage_Submit_failed; } <START> message = message.replaceAll("\n", " "); END> getTaskEditor().setMessage(message, IMessageProvider.ERROR, new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { TasksUiInternal.displayStatus(Messages.AbstractTaskEditorPage_Submit_failed, status); } }); } } else { String message; if (status.getCode() == RepositoryStatus.ERROR_IO) { message = ERROR_NOCONNECTIVITY; } else if (status.getMessage().length() > 0) { if (status.getMessage().length() < 100) { message = Messages.AbstractTaskEditorPage_Submit_failed_ + status.getMessage(); } else { message = Messages.AbstractTaskEditorPage_Submit_failed_ + status.getMessage().substring(0, 100) + "..."; } } else { message = Messages.AbstractTaskEditorPage_Submit_failed; } getTaskEditor().setMessage(message, IMessageProvider.ERROR, new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { TasksUiInternal.displayStatus(Messages.AbstractTaskEditorPage_Submit_failed, status); } }); } } }</code><technical_language>I do this below</technical_language>

Target:
private void handleSubmitError(SubmitJob job) { if (form != null && !form.isDisposed()) { final IStatus status = job.getStatus(); String message = null; if (status.getCode() == RepositoryStatus.REPOSITORY_COMMENT_REQUIRED) { TasksUiInternal.displayStatus(Messages.AbstractTaskEditorPage_Comment_required, status); AbstractTaskEditorPart newCommentPart = getPart(ID_PART_NEW_COMMENT); if (newCommentPart != null) { newCommentPart.setFocus(); } } else if (status.getCode() == RepositoryStatus.ERROR_REPOSITORY_LOGIN) { if (TasksUiUtil.openEditRepositoryWizard(getTaskRepository()) == Window.OK) { submitEnabled = true; doSubmit(); return; } else { message = getMessageFromStatus(status); } } else { if (status.getCode() == RepositoryStatus.ERROR_IO) { message = ERROR_NOCONNECTIVITY; } else { message = getMessageFromStatus(status); if (message == null) { message = Messages.AbstractTaskEditorPage_Submit_failed; } } } if (message != null) { getTaskEditor().setMessage(message, IMessageProvider.ERROR, new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { TasksUiInternal.displayStatus(Messages.AbstractTaskEditorPage_Submit_failed, status); } }); } } }