Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
20 | 2 | 5 | 0.972 | class_body_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 19 | 85 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/GenerateHashCodeEqualsDialog.java |
2 | 20 | 236 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OverrideMethodDialog.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) } )); } } |
| ||||
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) } )); } } |
| |||
/** * 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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#9c3cf440]] | OverrideMethodValidator |
1 | 2 | [[#9c3cf440]] | GenerateHashCodeEqualsValidator |
2 | 1 | [[#9c3cf380]] | fNumMethods |
2 | 2 | [[#9c3cf380]] | fNumFields |
3 | 1 | [[#9c3cf2a0]] | IMethodBinding |
3 | 2 | [[#9c3cf2a0]] | IVariableBinding |
4 | 1 | [[#9c3cf200]] | "" |
4 | 2 | [[#9c3cf200]] | JavaUIMessages.GenerateHashCodeEqualsDialog_select_at_least_one_field |
5 | 1 | [[#9c3cf0e0]] | OverrideMethodDialog_selectioninfo_more |
5 | 2 | [[#9c3cf0e0]] | GenerateHashCodeEqualsDialog_selectioninfo_more |