CloneSet1040


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
20250.972class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
11985
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/GenerateHashCodeEqualsDialog.java
220236
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OverrideMethodDialog.java
Clone Instance
1
Line Count
19
Source Line
85
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/GenerateHashCodeEqualsDialog.java

        /**
         * Validator for the input of the generate hashCode() and equals() dialog.
         * 
         * @since 3.2
         * 
         */
        private static class GenerateHashCodeEqualsValidator implements ISelectionStatusValidator {

                private static int fNumFields;

                public GenerateHashCodeEqualsValidator(int entries) {
                        fNumFields = entries;
                }

                public IStatus validate(Object[] selection) {
                        int count = 0;
                        for (int index = 0; index < selection.length; index++) {
                                if (selection[index] instanceof IVariableBinding)
                                        count++;
                        }
                        if (count == 0)
                                return new StatusInfo(IStatus.ERROR, JavaUIMessages.GenerateHashCodeEqualsDialog_select_at_least_one_field);

                        return new StatusInfo(IStatus.INFO, Messages.format(JavaUIMessages.GenerateHashCodeEqualsDialog_selectioninfo_more, new String[] {
                                        String.valueOf(count), String.valueOf(fNumFields)
                                                                                                                                                         } ));
                }
        }


Clone Instance
2
Line Count
20
Source Line
236
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OverrideMethodDialog.java

        private static class OverrideMethodValidator implements ISelectionStatusValidator {

                private static int fNumMethods;

                public OverrideMethodValidator(int entries) {
                        fNumMethods = entries;
                }

                /*
                 * @see ISelectionValidator#validate(Object[])
                 */
                public IStatus validate(Object[] selection) {
                        int count = 0;
                        for (int index = 0; index < selection.length; index++) {
                                if (selection[index] instanceof IMethodBinding)
                                        count++;
                        }
                        if (count == 0)
                                return new StatusInfo(IStatus.ERROR, ""); //$NON-NLS-1$
                        return new StatusInfo(IStatus.INFO, Messages.format(JavaUIMessages.OverrideMethodDialog_selectioninfo_more, new String[] {
                                                                                                                                                   String.valueOf(count), String.valueOf(fNumMethods)
                                                                                                                                                 } ));
                }
        }


Clone AbstractionParameter Count: 5Parameter Bindings

/**
         * Validator for the input of the generate hashCode() and equals() dialog.
         * 
         * @since 3.2
         * 
         */
private static class [[#variable9c3cf440]]implements ISelectionStatusValidator {
  private static int  [[#variable9c3cf380]];

  public [[#variable9c3cf440]](int entries) {
     [[#variable9c3cf380]]= entries;
  }

  /*
                   * @see ISelectionValidator#validate(Object[])
                   */
  public IStatus validate(Object[] selection) {
    int count = 0;
    for (int index = 0; index < selection.length; index++) {
      if (selection[index] instanceof [[#variable9c3cf2a0]])
        count++;
    }
    if (count == 0)
      return new StatusInfo(IStatus.ERROR,  [[#variable9c3cf200]]); //$NON-NLS-1$
    return new StatusInfo(IStatus.INFO, Messages.format(JavaUIMessages. [[#variable9c3cf0e0]], new String[] {
                                                                                                              String.valueOf(count),
                                                                                                              String.valueOf( [[#variable9c3cf380]])
                                                                                                            } ));
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#9c3cf440]]
OverrideMethodValidator 
12[[#9c3cf440]]
GenerateHashCodeEqualsValidator 
21[[#9c3cf380]]
fNumMethods 
22[[#9c3cf380]]
fNumFields 
31[[#9c3cf2a0]]
IMethodBinding 
32[[#9c3cf2a0]]
IVariableBinding 
41[[#9c3cf200]]
"" 
42[[#9c3cf200]]
JavaUIMessages.GenerateHashCodeEqualsDialog_select_at_least_one_field 
51[[#9c3cf0e0]]
OverrideMethodDialog_selectioninfo_more 
52[[#9c3cf0e0]]
GenerateHashCodeEqualsDialog_selectioninfo_more