CloneSet120


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
43330.996class_body_declarations[4]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
14390
plugins/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/util/ExceptionHandler.java
24157
plugins/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/ExceptionHandler.java
34392
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/ExceptionHandler.java
Clone Instance
1
Line Count
43
Source Line
90
Source File
plugins/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/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());
        }


Clone Instance
2
Line Count
41
Source Line
57
Source File
plugins/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/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) {
                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());
        }


Clone Instance
3
Line Count
43
Source Line
92
Source File
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) {
                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());
        }


Clone AbstractionParameter Count: 3Parameter Bindings

/**
         * 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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b47ec920]]
AptUIPlugin 
12[[#b47ec920]]
JUnitPlugin 
13[[#b47ec920]]
JavaPlugin 
21[[#4e3d0520]]
Messages 
22[[#4e3d0520]]
WizardMessages 
23[[#4e3d0520]]
JavaUIMessages 
31[[#4e3d0500]]
ExceptionHandler_seeErrorLog 
32[[#4e3d0500]]
ExceptionDialog_seeErrorLogMessage 
33[[#4e3d0500]]
ExceptionDialog_seeErrorLogMessage