Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
70 | 2 | 5 | 0.989 | class_body_declarations[6] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 70 | 119 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ReadReferencesSearchGroup.java |
2 | 70 | 119 | 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 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(); } |
| ||||
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(); } |
| |||
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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#ba89ba00]] | FindWriteReferencesInWorkingSetAction |
1 | 2 | [[#ba89ba00]] | FindReadReferencesInWorkingSetAction |
2 | 1 | [[#ba89b860]] | fFindWriteReferencesAction |
2 | 2 | [[#ba89b860]] | fFindReadReferencesAction |
3 | 1 | [[#ba89b8c0]] | fFindWriteReferencesInProjectAction |
3 | 2 | [[#ba89b8c0]] | fFindReadReferencesInProjectAction |
4 | 1 | [[#b95f0e00]] | fFindWriteReferencesInHierarchyAction |
4 | 2 | [[#b95f0e00]] | fFindReadReferencesInHierarchyAction |
5 | 1 | [[#ba89b960]] | fFindWriteReferencesInWorkingSetAction |
5 | 2 | [[#ba89b960]] | fFindReadReferencesInWorkingSetAction |