File path: /emf-2.4.1/src/org/eclipse/emf/mapping/command/RemoveOverrideCommand.java | File path: /emf-2.4.1/src/org/eclipse/emf/mapping/command/SetOverrideCommand.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | Object object = objects.next();↵ | 1 | Object object = objects.next();↵ | |
2 | for (Mapping mapping : mappingRoot.getMappings(object))↵ | 2 | for (Mapping mapping : mappingRoot.getMappings(object))↵ | |
3 | {↵ | 3 | {↵ | |
4 | Collection<?> outputs = mapping.getOutputs();↵ | 4 | Collection<?> outputs = mapping.getOutputs();↵ | |
5 | if (outputs.size() == 1 && outputs.iterator().next() == object)↵ | 5 | if (outputs.size() == 1 && outputs.iterator().next() == object)↵ | |
6 | {↵ | 6 | {↵ | |
7 | commandList.add(RemoveMappingCommand.create(mappingDomain, mapping));↵ | 7 | subcommands.append(RemoveMappingCommand.create(mappingDomain, mapping));↵ | |
8 | }↵ | 8 | }↵ | |
9 | else↵ | 9 | else↵ | |
10 | {↵ | 10 | {↵ | |
11 | //commandList.add↵ | 11 | subcommands.append(↵ | |
12 | (RemoveCommand.create(mappingDomain, mapping, mapping.ePackageMapping().getMapping_Outputs(), object));↵ | 12 | //(RemoveCommand.create(mappingDomain, mapping, mapping.ePackageMapping().getMapping_Outputs(), object)));↵ | |
13 | commandList.add(RemoveCommand.create(mappingDomain, mapping, MappingPackage.eINSTANCE.getMapping_Outputs(), object));↵ | 13 | (RemoveCommand.create(mappingDomain, mapping, MappingPackage.eINSTANCE.getMapping_Outputs(), object)));↵ | |
14 | }↵ | 14 | }↵ | |
15 | } | 15 |
| |
See real code fragment | See real code fragment |
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.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 17 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 6096.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | Object object = objects.next(); |
| | ||||||||||||||||||||||||||||
|
| 7 | Object object = objects.next(); | ||||||||||||||||||||||||||||
7 | for (Mapping mapping : mappingRoot.getMappings(object)) | 8 | for (Mapping mapping : mappingRoot.getMappings(object)) | ||||||||||||||||||||||||||||
8 | Collection<?> outputs = mapping.getOutputs(); | 9 | Collection<?> outputs = mapping.getOutputs(); | ||||||||||||||||||||||||||||
9 | if (outputs.size() == 1 && outputs.iterator().next() == object) |
| 10 | if (outputs.size() == 1 && outputs.iterator().next() == object) | |||||||||||||||||||||||||||
10 | commandList.add(RemoveMappingCommand.create(mappingDomain, mapping)); |
| | ||||||||||||||||||||||||||||
else | | ||||||||||||||||||||||||||||||
11 | commandList.add(RemoveCommand.create(mappingDomain, mapping, MappingPackage.eINSTANCE.getMapping_Outputs(), object)); |
| | ||||||||||||||||||||||||||||
|
| 12 | subcommands.append((RemoveCommand.create(mappingDomain, mapping, MappingPackage.eINSTANCE.getMapping_Outputs(), object))); | ||||||||||||||||||||||||||||
|
| 11 | subcommands.append(RemoveMappingCommand.create(mappingDomain, mapping)); |
Row | Violation |
---|---|
1 | Unmatched statement Object object=objects.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement Object object=objects.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type java.util.Collection<> of variable outputs does not match with type java.util.Collection<> of variable outputs |
4 | Expression outputs.iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression outputs.iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type of variable outputs.iterator().next() does not match with type of variable outputs.iterator().next() |
7 | Expression outputs.iterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression outputs.iterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Type java.util.Iterator<> of variable outputs.iterator() does not match with type java.util.Iterator<> of variable outputs.iterator() |
10 | Type java.util.Collection<> of variable outputs does not match with type java.util.Collection<> of variable outputs |
11 | Unmatched statement commandList.add(RemoveMappingCommand.create(mappingDomain,mapping)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
12 | Unmatched statement commandList.add(RemoveCommand.create(mappingDomain,mapping,MappingPackage.eINSTANCE.getMapping_Outputs(),object)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
13 | Unmatched statement subcommands.append((RemoveCommand.create(mappingDomain,mapping,MappingPackage.eINSTANCE.getMapping_Outputs(),object))); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
14 | Unmatched statement subcommands.append(RemoveMappingCommand.create(mappingDomain,mapping)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |