Collection<?> inputsToRemove = new ArrayList<Object>(mapping.getInputs());
inputsToRemove.retainAll(collectionOfDescendants);
if (!inputsToRemove.isEmpty())
{
Command removeInputsCommand =
RemoveCommand.create(domain, mapping, MappingPackage.eINSTANCE.getMapping_Inputs(), inputsToRemove);
commands.appendIfCanExecute(removeInputsCommand);
}
Collection<?> outputsToRemove = new ArrayList<Object>(mapping.getOutputs());
outputsToRemove.retainAll(collectionOfDescendants);
if (!outputsToRemove.isEmpty())
{
Command removeOutputsCommand =
RemoveCommand.create(domain, mapping, MappingPackage.eINSTANCE.getMapping_Outputs(), outputsToRemove);
commands.appendIfCanExecute(removeOutputsCommand);
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/provider/MappingItemProvider.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/provider/MappingItemProvider.java
|
Method name: void execute()
|
|
Method name: void execute()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | Collection<?> inputsToRemove = new ArrayList<Object>(mapping.getInputs());↵ | | 1 | Collection<?> outputsToRemove = new ArrayList<Object>(mapping.getOutputs());↵
|
2 | inputsToRemove.retainAll(collectionOfDescendants);↵ | | 2 | outputsToRemove.retainAll(collectionOfDescendants);↵
|
3 | if (!inputsToRemove.isEmpty())↵ | | 3 | if (!outputsToRemove.isEmpty())↵
|
4 | {↵ | | 4 | {↵
|
5 | Command removeInputsCommand = ↵ | | 5 | Command removeOutputsCommand = ↵
|
6 | RemoveCommand.create(domain, mapping, MappingPackage.eINSTANCE.getMapping_Inputs(), inputsToRemove);↵ | | 6 | RemoveCommand.create(domain, mapping, MappingPackage.eINSTANCE.getMapping_Outputs(), outputsToRemove);↵
|
7 | commands.appendIfCanExecute(removeInputsCommand);↵ | | 7 | commands.appendIfCanExecute(removeOutputsCommand);↵
|
8 | } | | 8 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 1 |