Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
43 | 3 | 3 | 0.996 | class_body_declarations[4] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 43 | 90 | plugins/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/util/ExceptionHandler.java |
2 | 41 | 57 | plugins/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/ExceptionHandler.java |
3 | 43 | 92 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/ExceptionHandler.java |
| ||||
/** * Handles the given <code>InvocationTargetException</code>. * * @param e the <code>InvocationTargetException</code> to be handled * @param parent the dialog window's parent shell * @param title the dialog window's window title * @param message message to be displayed by the dialog window */ public static void handle(InvocationTargetException e, Shell parent, String title, String message) { fgInstance.perform(e, parent, title, message); } //---- Hooks for subclasses to control exception handling ------------------------------------ protected void perform(CoreException e, Shell shell, String title, String message) { AptUIPlugin.log(e); IStatus status = e.getStatus(); if (status != null) { ErrorDialog.openError(shell, title, message, status); } else { displayMessageDialog(e, e.getMessage(), shell, title, message); } } protected void perform(InvocationTargetException e, Shell shell, String title, String message) { Throwable target = e.getTargetException(); if (target instanceof CoreException) { perform((CoreException) target, shell, title, message); } else { AptUIPlugin.log(e); if (e.getMessage() != null && e.getMessage().length() > 0) { displayMessageDialog(e, e.getMessage(), shell, title, message); } else { displayMessageDialog(e, target.getMessage(), shell, title, message); } } } //---- Helper methods ----------------------------------------------------------------------- private void displayMessageDialog(Throwable t, String exceptionMessage, Shell shell, String title, String message) { StringWriter msg = new StringWriter(); if (message != null) { msg.write(message); msg.write("\n\n"); //$NON-NLS-1$ } if (exceptionMessage == null || exceptionMessage.length() == 0) msg.write(Messages.ExceptionHandler_seeErrorLog); else msg.write(exceptionMessage); MessageDialog.openError(shell, title, msg.toString()); } |
| ||||
/** * Handles the given <code>InvocationTargetException</code>. * * @param e the <code>InvocationTargetException</code> to be handled * @param parent the dialog window's parent shell * @param title the dialog window's window title * @param message message to be displayed by the dialog window */ public static void handle(InvocationTargetException e, Shell parent, String title, String message) { fgInstance.perform(e, parent, title, message); } //---- Hooks for subclasses to control exception handling ------------------------------------ protected void perform(CoreException e, Shell shell, String title, String message) { JUnitPlugin.log(e); IStatus status = e.getStatus(); if (status != null) { ErrorDialog.openError(shell, title, message, status); } else { displayMessageDialog(e, e.getMessage(), shell, title, message); } } protected void perform(InvocationTargetException e, Shell shell, String title, String message) { Throwable target = e.getTargetException(); if (target instanceof CoreException) { perform((CoreException) target, shell, title, message); } else { JUnitPlugin.log(e); if (e.getMessage() != null && e.getMessage().length() > 0) { displayMessageDialog(e, e.getMessage(), shell, title, message); } else { displayMessageDialog(e, target.getMessage(), shell, title, message); } } } private void displayMessageDialog(Throwable t, String exceptionMessage, Shell shell, String title, String message) { StringWriter msg = new StringWriter(); if (message != null) { msg.write(message); msg.write("\n\n"); //$NON-NLS-1$ } if (exceptionMessage == null || exceptionMessage.length() == 0) msg.write(WizardMessages.ExceptionDialog_seeErrorLogMessage); else msg.write(exceptionMessage); MessageDialog.openError(shell, title, msg.toString()); } |
| ||||
/** * Handles the given <code>InvocationTargetException</code>. * * @param e the <code>InvocationTargetException</code> to be handled * @param parent the dialog window's parent shell * @param title the dialog window's window title * @param message message to be displayed by the dialog window */ public static void handle(InvocationTargetException e, Shell parent, String title, String message) { fgInstance.perform(e, parent, title, message); } //---- Hooks for subclasses to control exception handling ------------------------------------ protected void perform(CoreException e, Shell shell, String title, String message) { JavaPlugin.log(e); IStatus status = e.getStatus(); if (status != null) { ErrorDialog.openError(shell, title, message, status); } else { displayMessageDialog(e, e.getMessage(), shell, title, message); } } protected void perform(InvocationTargetException e, Shell shell, String title, String message) { Throwable target = e.getTargetException(); if (target instanceof CoreException) { perform((CoreException) target, shell, title, message); } else { JavaPlugin.log(e); if (e.getMessage() != null && e.getMessage().length() > 0) { displayMessageDialog(e, e.getMessage(), shell, title, message); } else { displayMessageDialog(e, target.getMessage(), shell, title, message); } } } //---- Helper methods ----------------------------------------------------------------------- private void displayMessageDialog(Throwable t, String exceptionMessage, Shell shell, String title, String message) { StringWriter msg = new StringWriter(); if (message != null) { msg.write(message); msg.write("\n\n"); //$NON-NLS-1$ } if (exceptionMessage == null || exceptionMessage.length() == 0) msg.write(JavaUIMessages.ExceptionDialog_seeErrorLogMessage); else msg.write(exceptionMessage); MessageDialog.openError(shell, title, msg.toString()); } |
| |||
/** * Handles the given <code>InvocationTargetException</code>. * * @param e the <code>InvocationTargetException</code> to be handled * @param parent the dialog window's parent shell * @param title the dialog window's window title * @param message message to be displayed by the dialog window */ public static void handle(InvocationTargetException e, Shell parent, String title, String message) { fgInstance.perform(e, parent, title, message); } //---- Hooks for subclasses to control exception handling ------------------------------------ protected void perform(CoreException e, Shell shell, String title, String message) { [[#variableb47ec920]].log(e); IStatus status = e.getStatus(); if (status != null) { ErrorDialog.openError(shell, title, message, status); } else { displayMessageDialog(e, e.getMessage(), shell, title, message); } } protected void perform(InvocationTargetException e, Shell shell, String title, String message) { Throwable target = e.getTargetException(); if (target instanceof CoreException) { perform((CoreException) target, shell, title, message); } else { [[#variableb47ec920]].log(e); if (e.getMessage() != null && e.getMessage().length() > 0) { displayMessageDialog(e, e.getMessage(), shell, title, message); } else { displayMessageDialog(e, target.getMessage(), shell, title, message); } } } //---- Helper methods ----------------------------------------------------------------------- private void displayMessageDialog(Throwable t, String exceptionMessage, Shell shell, String title, String message) { StringWriter msg = new StringWriter(); if (message != null) { msg.write(message); msg.write("\n\n"); //$NON-NLS-1$ } if (exceptionMessage == null || exceptionMessage.length() == 0) msg.write( [[#variable4e3d0520]]. [[#variable4e3d0500]]); else msg.write(exceptionMessage); MessageDialog.openError(shell, title, msg.toString()); } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#b47ec920]] | AptUIPlugin |
1 | 2 | [[#b47ec920]] | JUnitPlugin |
1 | 3 | [[#b47ec920]] | JavaPlugin |
2 | 1 | [[#4e3d0520]] | Messages |
2 | 2 | [[#4e3d0520]] | WizardMessages |
2 | 3 | [[#4e3d0520]] | JavaUIMessages |
3 | 1 | [[#4e3d0500]] | ExceptionHandler_seeErrorLog |
3 | 2 | [[#4e3d0500]] | ExceptionDialog_seeErrorLogMessage |
3 | 3 | [[#4e3d0500]] | ExceptionDialog_seeErrorLogMessage |