Source:
public static void showError(String message, Throwable t) { TemplateEngineUtil.log(t); IStatus status; if (t != null) { if (t instanceof ProcessFailureException) { List<IStatus> statuses = ((ProcessFailureException) t).getStatuses(); if (statuses == null || statuses.isEmpty()) { Throwable p = t; do { p = p.getCause(); if (p != null && p instanceof ProcessFailureException) { statuses = ((ProcessFailureException) p).getStatuses(); } } while ((statuses == null || statuses.isEmpty()) && p != null && p instanceof ProcessFailureException); if (statuses == null || statuses.isEmpty()) { status = new Status(IStatus.ERROR, CUIPlugin.getPluginId(), IStatus.ERROR, t.getMessage(), t); } else { status = new MultiStatus(CUIPlugin.getPluginId(), IStatus.ERROR, statuses.toArray(new IStatus[statuses.size()]), t.getMessage(), t); } } else { status = new MultiStatus(CUIPlugin.getPluginId(), IStatus.ERROR, statuses.toArray(new IStatus[statuses.size()]), t.getMessage(), t); } } else if (t instanceof CoreException) { status = ((CoreException) t).getStatus(); if (status != null && message.equals(status.getMessage())) { message = null; } } else { status = new Status(IStatus.ERROR, CUIPlugin.getPluginId(), -1, TemplateEngineMessages.getString("TemplateEngine.internalError") + message, t); } } else { status = new Status(IStatus.ERROR, CUIPlugin.getPluginId(), -1, TemplateEngineMessages.getString("TemplateEngine.internalError") + message, null); } IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if(window == null){ IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); window = windows[0]; } ErrorDialog.openError(window.getShell(), TemplateEngineMessages.getString("TemplateEngine.templateEngine"), message, status); }

Target:
public static void showError(String message, Throwable t) { TemplateEngineUtil.log(t); IStatus status; if (t != null) { if (t instanceof ProcessFailureException) { List<IStatus> statuses = ((ProcessFailureException) t).getStatuses(); if (statuses == null || statuses.isEmpty()) { Throwable p = t; do { p = p.getCause(); if (p instanceof ProcessFailureException) { statuses = ((ProcessFailureException) p).getStatuses(); } } while ((statuses == null || statuses.isEmpty()) && p != null && p instanceof ProcessFailureException); if (statuses == null || statuses.isEmpty()) { status = new Status(IStatus.ERROR, CUIPlugin.getPluginId(), IStatus.ERROR, t.getMessage(), t); } else { status = new MultiStatus(CUIPlugin.getPluginId(), IStatus.ERROR, statuses.toArray(new IStatus[statuses.size()]), t.getMessage(), t); } } else { status = new MultiStatus(CUIPlugin.getPluginId(), IStatus.ERROR, statuses.toArray(new IStatus[statuses.size()]), t.getMessage(), t); } } else if (t instanceof CoreException) { status = ((CoreException) t).getStatus(); if (status != null && message.equals(status.getMessage())) { message = null; } } else { status = new Status(IStatus.ERROR, CUIPlugin.getPluginId(), -1, TemplateEngineMessages.getString("TemplateEngine.internalError") + message, t); } } else { status = new Status(IStatus.ERROR, CUIPlugin.getPluginId(), -1, TemplateEngineMessages.getString("TemplateEngine.internalError") + message, null); } IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if(window == null){ IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); window = windows[0]; } ErrorDialog.openError(window.getShell(), TemplateEngineMessages.getString("TemplateEngine.templateEngine"), message, status); }