CloneSet170


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
70250.989class_body_declarations[6]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
170119
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ReadReferencesSearchGroup.java
270119
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/WriteReferencesSearchGroup.java
Clone Instance
1
Line Count
70
Source Line
119
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ReadReferencesSearchGroup.java

        private void registerAction(SelectionDispatchAction action, ISelectionProvider provider, ISelection selection) {
                action.update(selection);
                provider.addSelectionChangedListener(action);
        }

        private void addAction(IAction action, IMenuManager manager) {
                if (action.isEnabled()) {
                        manager.add(action);
                }
        }

        private void addWorkingSetAction(IWorkingSet[] workingSets, IMenuManager manager) {
                FindAction action;
                if (fEditor != null)
                        action = new WorkingSetFindAction(fEditor, new FindReadReferencesInWorkingSetAction(fEditor, workingSets), SearchUtil.toString(workingSets));
                else
                        action = new WorkingSetFindAction(fSite, new FindReadReferencesInWorkingSetAction(fSite, workingSets), SearchUtil.toString(workingSets));
                action.update(getContext().getSelection());
                addAction(action, manager);
        }


        /* (non-Javadoc)
         * Method declared on ActionGroup.
         */
        public void fillContextMenu(IMenuManager manager) {
                MenuManager javaSearchMM = new MenuManager(MENU_TEXT, IContextMenuConstants.GROUP_SEARCH);
                addAction(fFindReadReferencesAction, javaSearchMM);
                addAction(fFindReadReferencesInProjectAction, javaSearchMM);
                addAction(fFindReadReferencesInHierarchyAction, javaSearchMM);

                javaSearchMM.add(new Separator());

                Iterator iter = SearchUtil.getLRUWorkingSets().sortedIterator();
                while (iter.hasNext()) {
                        addWorkingSetAction((IWorkingSet[]) iter.next(), javaSearchMM);
                }
                addAction(fFindReadReferencesInWorkingSetAction, javaSearchMM);

                if ( !javaSearchMM.isEmpty())
                        manager.appendToGroup(fGroupId, javaSearchMM);
        }

        /* 
         * Method declared on ActionGroup.
         */
        public void fillActionBars(IActionBars actionBars) {
                Assert.isNotNull(actionBars);
                super.fillActionBars(actionBars);
                fActionBars = actionBars;
                updateGlobalActionHandlers();
        }

        /* 
         * Method declared on ActionGroup.
         */
        public void dispose() {
                ISelectionProvider provider = fSite.getSelectionProvider();
                if (provider != null) {
                        disposeAction(fFindReadReferencesAction, provider);
                        disposeAction(fFindReadReferencesInProjectAction, provider);
                        disposeAction(fFindReadReferencesInHierarchyAction, provider);
                        disposeAction(fFindReadReferencesInWorkingSetAction, provider);
                }
                fFindReadReferencesAction = null;
                fFindReadReferencesInProjectAction = null;
                fFindReadReferencesInHierarchyAction = null;
                fFindReadReferencesInWorkingSetAction = null;
                updateGlobalActionHandlers();
                super.dispose();
        }


Clone Instance
2
Line Count
70
Source Line
119
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/WriteReferencesSearchGroup.java

        private void registerAction(SelectionDispatchAction action, ISelectionProvider provider, ISelection selection) {
                action.update(selection);
                provider.addSelectionChangedListener(action);
        }

        private void addAction(IAction action, IMenuManager manager) {
                if (action.isEnabled()) {
                        manager.add(action);
                }
        }

        private void addWorkingSetAction(IWorkingSet[] workingSets, IMenuManager manager) {
                FindAction action;
                if (fEditor != null)
                        action = new WorkingSetFindAction(fEditor, new FindWriteReferencesInWorkingSetAction(fEditor, workingSets), SearchUtil.toString(workingSets));
                else
                        action = new WorkingSetFindAction(fSite, new FindWriteReferencesInWorkingSetAction(fSite, workingSets), SearchUtil.toString(workingSets));
                action.update(getContext().getSelection());
                addAction(action, manager);
        }


        /* (non-Javadoc)
         * Method declared on ActionGroup.
         */
        public void fillContextMenu(IMenuManager manager) {
                MenuManager javaSearchMM = new MenuManager(MENU_TEXT, IContextMenuConstants.GROUP_SEARCH);
                addAction(fFindWriteReferencesAction, javaSearchMM);
                addAction(fFindWriteReferencesInProjectAction, javaSearchMM);
                addAction(fFindWriteReferencesInHierarchyAction, javaSearchMM);

                javaSearchMM.add(new Separator());

                Iterator iter = SearchUtil.getLRUWorkingSets().sortedIterator();
                while (iter.hasNext()) {
                        addWorkingSetAction((IWorkingSet[]) iter.next(), javaSearchMM);
                }
                addAction(fFindWriteReferencesInWorkingSetAction, javaSearchMM);

                if ( !javaSearchMM.isEmpty())
                        manager.appendToGroup(fGroupId, javaSearchMM);
        }

        /* 
         * Method declared on ActionGroup.
         */
        public void fillActionBars(IActionBars actionBars) {
                Assert.isNotNull(actionBars);
                super.fillActionBars(actionBars);
                fActionBars = actionBars;
                updateGlobalActionHandlers();
        }

        /* 
         * Method declared on ActionGroup.
         */
        public void dispose() {
                ISelectionProvider provider = fSite.getSelectionProvider();
                if (provider != null) {
                        disposeAction(fFindWriteReferencesAction, provider);
                        disposeAction(fFindWriteReferencesInProjectAction, provider);
                        disposeAction(fFindWriteReferencesInHierarchyAction, provider);
                        disposeAction(fFindWriteReferencesInWorkingSetAction, provider);
                }
                fFindWriteReferencesAction = null;
                fFindWriteReferencesInProjectAction = null;
                fFindWriteReferencesInHierarchyAction = null;
                fFindWriteReferencesInWorkingSetAction = null;
                updateGlobalActionHandlers();
                super.dispose();
        }


Clone AbstractionParameter Count: 5Parameter Bindings

private void registerAction(SelectionDispatchAction action, ISelectionProvider provider, ISelection selection) {
  action.update(selection);
  provider.addSelectionChangedListener(action);
}

private void addAction(IAction action, IMenuManager manager) {
  if (action.isEnabled()) {
    manager.add(action);
  }
}

private void addWorkingSetAction(IWorkingSet[] workingSets, IMenuManager manager) {
  FindAction action;
  if (fEditor != null)
    action = new WorkingSetFindAction(fEditor, new [[#variableba89ba00]](fEditor, workingSets), SearchUtil.toString(workingSets));
  else
    action = new WorkingSetFindAction(fSite, new [[#variableba89ba00]](fSite, workingSets), SearchUtil.toString(workingSets));
  action.update(getContext().getSelection());
  addAction(action, manager);
}

/* (non-Javadoc)
         * Method declared on ActionGroup.
         */
public void fillContextMenu(IMenuManager manager) {
  MenuManager javaSearchMM = new MenuManager(MENU_TEXT, IContextMenuConstants.GROUP_SEARCH);
  addAction( [[#variableba89b860]], javaSearchMM);
  addAction( [[#variableba89b8c0]], javaSearchMM);
  addAction( [[#variableb95f0e00]], javaSearchMM);
  javaSearchMM.add(new Separator());
  Iterator iter = SearchUtil.getLRUWorkingSets().sortedIterator();
  while (iter.hasNext()) {
    addWorkingSetAction((IWorkingSet[]) iter.next(), javaSearchMM);
  }
  addAction( [[#variableba89b960]], javaSearchMM);
  if ( !javaSearchMM.isEmpty())
    manager.appendToGroup(fGroupId, javaSearchMM);
}

/* 
         * Method declared on ActionGroup.
         */
public void fillActionBars(IActionBars actionBars) {
  Assert.isNotNull(actionBars);
  super.fillActionBars(actionBars);
  fActionBars = actionBars;
  updateGlobalActionHandlers();
}

/* 
         * Method declared on ActionGroup.
         */
public void dispose() {
  ISelectionProvider provider = fSite.getSelectionProvider();
  if (provider != null) {
    disposeAction( [[#variableba89b860]], provider);
    disposeAction( [[#variableba89b8c0]], provider);
    disposeAction( [[#variableb95f0e00]], provider);
    disposeAction( [[#variableba89b960]], provider);
  }
   [[#variableba89b860]]= null;
   [[#variableba89b8c0]]= null;
   [[#variableb95f0e00]]= null;
   [[#variableba89b960]]= null;
  updateGlobalActionHandlers();
  super.dispose();
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#ba89ba00]]
FindWriteReferencesInWorkingSetAction 
12[[#ba89ba00]]
FindReadReferencesInWorkingSetAction 
21[[#ba89b860]]
fFindWriteReferencesAction 
22[[#ba89b860]]
fFindReadReferencesAction 
31[[#ba89b8c0]]
fFindWriteReferencesInProjectAction 
32[[#ba89b8c0]]
fFindReadReferencesInProjectAction 
41[[#b95f0e00]]
fFindWriteReferencesInHierarchyAction 
42[[#b95f0e00]]
fFindReadReferencesInHierarchyAction 
51[[#ba89b960]]
fFindWriteReferencesInWorkingSetAction 
52[[#ba89b960]]
fFindReadReferencesInWorkingSetAction