CloneSet390


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
30230.981class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
127480
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddDelegateMethodsAction.java
230521
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
Clone Instance
1
Line Count
27
Source Line
480
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddDelegateMethodsAction.java

        /*
         * (non-Javadoc) Method declared on SelectionDispatchAction
         */
        public void run(ITextSelection selection) {
                try {
                        if ( !ActionUtil.isProcessable(getShell(), fEditor))
                                return;

                        IJavaElement[] elements = SelectionConverter.codeResolveForked(fEditor, true);
                        if (elements.length == 1 && (elements[0] instanceof IField)) {
                                IField field = (IField) elements[0];
                                run(field.getDeclaringType(), new IField[] {
                                                                             field
                                                                           },        true);
                                return;
                        }
                        IJavaElement element = SelectionConverter.getElementAtOffset(fEditor);
                        if (element != null) {
                                IType type = (IType) element.getAncestor(IJavaElement.TYPE);
                                if (type != null) {
                                        if (type.getFields().length > 0) {
                                                run(type, new IField[0], true);
                                                return;
                                        }
                                }
                        }
                        MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_not_applicable);
                } catch (CoreException e) {
                        ExceptionHandler.handle(e, getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_error_actionfailed);
                  }
                  catch (InvocationTargetException e) {
                        ExceptionHandler.handle(e, getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_error_actionfailed);
                  }
                  catch (InterruptedException e) {
                        // cancelled
                  }
        }


Clone Instance
2
Line Count
30
Source Line
521
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java

        /*
         * (non-Javadoc) Method declared on SelectionDispatchAction
         */
        public void run(ITextSelection selection) {
                try {
                        if ( !ActionUtil.isProcessable(getShell(), fEditor)) {
                                notifyResult(false);
                                return;
                        }

                        IJavaElement[] elements = SelectionConverter.codeResolveForked(fEditor, true);
                        if (elements.length == 1 && (elements[0] instanceof IField)) {
                                IField field = (IField) elements[0];
                                run(field.getDeclaringType(), new IField[] {
                                                                             field
                                                                           },        true);
                                return;
                        }
                        IJavaElement element = SelectionConverter.getElementAtOffset(fEditor);
                        if (element != null) {
                                IType type = (IType) element.getAncestor(IJavaElement.TYPE);
                                if (type != null) {
                                        if (type.getFields().length > 0) {
                                                run(type, new IField[0], true);
                                                return;
                                        }
                                }
                        }
                        MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddGetterSetterAction_not_applicable);
                } catch (CoreException e) {
                        ExceptionHandler.handle(e, getShell(), DIALOG_TITLE, ActionMessages.AddGetterSetterAction_error_actionfailed);
                  }
                  catch (InvocationTargetException e) {
                        ExceptionHandler.handle(e, getShell(), DIALOG_TITLE, ActionMessages.AddGetterSetterAction_error_actionfailed);
                  }
                  catch (InterruptedException e) {
                        // cancelled
                  }
        }


Clone AbstractionParameter Count: 3Parameter Bindings

/*
         * (non-Javadoc) Method declared on SelectionDispatchAction
         */
public void run(ITextSelection selection) {
  try {
    if ( !ActionUtil.isProcessable(getShell(), fEditor))
       [[#variable908fef40]]
    IJavaElement[] elements = SelectionConverter.codeResolveForked(fEditor, true);
    if (elements.length == 1 && (elements[0] instanceof IField)) {
      IField field = (IField) elements[0];
      run(field.getDeclaringType(), new IField[] {
                                                   field
                                                 }, true);
      return;
    }
    IJavaElement element = SelectionConverter.getElementAtOffset(fEditor);
    if (element != null) {
      IType type = (IType) element.getAncestor(IJavaElement.TYPE);
      if (type != null) {
        if (type.getFields().length > 0) {
          run(type, new IField[0], true);
          return;
        }
      }
    }
    MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages. [[#variable59fc5140]]);
  }
  catch (CoreException e) {
    ExceptionHandler.handle(e, getShell(), DIALOG_TITLE, ActionMessages. [[#variable908fef60]]);
  }
  catch (InvocationTargetException e) {
    ExceptionHandler.handle(e, getShell(), DIALOG_TITLE, ActionMessages. [[#variable908fef60]]);
  }
  catch (InterruptedException e) {
  // cancelled
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#908fef40]]
{
  notifyResult(false);
  return;
} 
12[[#908fef40]]
return; 
21[[#59fc5140]]
AddGetterSetterAction_not_applicable 
22[[#59fc5140]]
AddDelegateMethodsAction_not_applicable 
31[[#908fef60]]
AddGetterSetterAction_error_actionfailed 
32[[#908fef60]]
AddDelegateMethodsAction_error_actionfailed