if (newObject == null)
{
error
(new ClassNotFoundException
(typeName,
factory,
getLocation(),
getLineNumber(),
getColumnNumber()));
}
if (node == null)
{
return null;
}
root.addNode(node);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHandler.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/parser/RoseParser.java
|
Method name: void validateCreateObjectFromFactory(EFactory, String, EObject)
|
|
Method name: RoseNode parseValue(String)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 3
|
|
1 | if (newObject == null)↵ | | 1 | if (node == null)↵
|
2 | {↵ | | 2 | ↵
|
3 | error↵ | | |
|
4 | (new ClassNotFoundException↵ | | |
|
5 | (typeName,↵ | | |
|
6 | factory,↵ | | |
|
7 | getLocation(),↵ | | |
|
8 | getLineNumber(),↵ | | |
|
9 | getColumnNumber()));↵ | | |
|
10 | } | | 3 | {↵
|
| | | 4 | return null;↵
|
| | | 5 | }↵
|
| | | 6 | root.addNode(node);
|
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 in different classes |
Number of node comparisons | 4 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (newObject == null) | | 25 | if (node == null) |
2 | error(new ClassNotFoundException(typeName, factory, getLocation(), getLineNumber(), getColumnNumber())); | | | |
| | | 26 | |
| | | 27 | root.addNode(node); |
Precondition Violations (2)
Row |
Violation |
1 | Type org.eclipse.emf.ecore.EObject of variable newObject does not match with type org.eclipse.emf.importer.rose.parser.RoseNode of variable node |
2 | Unmatched return null; |