Source:
public static String getTextForTask(Object object, Mode mode) { StringBuffer sb = new StringBuffer(); switch (mode) { case KEY: if (object instanceof ITask) { ITask task = (ITask) object; if (task.getTaskKey() != null) { sb.append(task.getTaskKey()); } } break; case URL: if (object instanceof IRepositoryElement) { String taskUrl = getUrl((IRepositoryElement) object); if (TasksUiInternal.isValidUrl(taskUrl)) { sb.append(taskUrl); } } break; case ID_SUMMARY: if (object instanceof ITask) { ITask task = (ITask) object; if (task.getTaskKey() != null) { sb.append(TasksUiInternal.getTaskPrefix(task.getConnectorKind())); sb.append(task.getTaskKey()); sb.append(": "); } sb.append(task.getSummary()); } else if (object instanceof IRepositoryElement) { IRepositoryElement element = (IRepositoryElement) object; sb.append(element.getSummary()); } break; case ID_SUMMARY_URL: if (object instanceof ITask) { ITask task = (ITask) object; if (task.getTaskKey() != null) { sb.append(task.getTaskKey()); sb.append(": "); } sb.append(task.getSummary()); String taskUrl = getUrl((IRepositoryElement) object); if (TasksUiInternal.isValidUrl(taskUrl)) { sb.append(ClipboardCopier.LINE_SEPARATOR); sb.append(taskUrl); } } else if (object instanceof IRepositoryQuery) { RepositoryQuery query = (RepositoryQuery) object; sb.append(query.getSummary()); if (TasksUiInternal.isValidUrl(query.getUrl())) { sb.append(ClipboardCopier.LINE_SEPARATOR); sb.append(query.getUrl()); } } else if (object instanceof IRepositoryElement) { IRepositoryElement element = (IRepositoryElement) object; sb.append(element.getSummary()); } break; } return sb.toString(); }

Target:
public static String getTextForTask(Object object, Mode mode) { StringBuffer sb = new StringBuffer(); switch (mode) { case KEY: if (object instanceof ITask) { ITask task = (ITask) object; if (task.getTaskKey() != null) { sb.append(task.getTaskKey()); } } break; case URL: if (object instanceof IRepositoryElement) { String taskUrl = getUrl((IRepositoryElement) object); if (TasksUiInternal.isValidUrl(taskUrl)) { sb.append(taskUrl); } } break; case ID_SUMMARY: if (object instanceof ITask) { ITask task = (ITask) object; if (task.getTaskKey() != null) { sb.append(StringUtils.capitalize(TasksUiInternal.getTaskPrefix(task.getConnectorKind()))); sb.append(task.getTaskKey()); sb.append(": "); } sb.append(task.getSummary()); } else if (object instanceof IRepositoryElement) { IRepositoryElement element = (IRepositoryElement) object; sb.append(element.getSummary()); } break; case ID_SUMMARY_URL: if (object instanceof ITask) { ITask task = (ITask) object; if (task.getTaskKey() != null) { sb.append(task.getTaskKey()); sb.append(": "); } sb.append(task.getSummary()); String taskUrl = getUrl((IRepositoryElement) object); if (TasksUiInternal.isValidUrl(taskUrl)) { sb.append(ClipboardCopier.LINE_SEPARATOR); sb.append(taskUrl); } } else if (object instanceof IRepositoryQuery) { RepositoryQuery query = (RepositoryQuery) object; sb.append(query.getSummary()); if (TasksUiInternal.isValidUrl(query.getUrl())) { sb.append(ClipboardCopier.LINE_SEPARATOR); sb.append(query.getUrl()); } } else if (object instanceof IRepositoryElement) { IRepositoryElement element = (IRepositoryElement) object; sb.append(element.getSummary()); } break; } return sb.toString(); }