if (!(page instanceof IPropertySheetPage))
{
actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);
actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction);
actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
}
if (!(part instanceof PropertySheet))
{
actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);
actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction);
actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/action/EditingDomainActionBarContributor.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/action/EditingDomainActionBarContributor.java
|
Method name: void shareGlobalActions(IPage, IActionBars)
|
|
Method name: void setActiveView(IViewPart)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (!(page instanceof IPropertySheetPage))↵ | | 1 | if (!(part instanceof PropertySheet))↵
|
2 | {↵ | | 2 | {↵
|
3 | actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);↵ | | 3 | actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);↵
|
4 | actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction);↵ | | 4 | actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction);↵
|
5 | actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);↵ | | 5 | actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);↵
|
6 | actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);↵ | | 6 | actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 25 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (!(page instanceof IPropertySheetPage)) | | 2 | if (!(part instanceof PropertySheet)) |
2 | actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction); | | 3 | actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction); |
3 | actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction); | | 4 | actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction); |
4 | actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction); | | 5 | actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction); |
5 | actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction); | | 6 | actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction); |
Precondition Violations (1)
Row |
Violation |
1 | Type org.eclipse.ui.part.IPage of variable page does not match with type org.eclipse.ui.IViewPart of variable part |