tok = lexer.getNext();
if (tok.getType() != RoseToken.RIGHT_PAREN)
{
System.out.println(" Parsing error in parseExpr - expecting right parenthesis");
return null;
}
tok = lexer.getNext();
if (tok.getType() != RoseToken.STRING)
{
System.out.println(" Parsing error in parseList - expecting string");
return null;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/parser/RoseParser.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/parser/RoseParser.java
|
Method name: RoseNode parseExpr(String)
|
|
Method name: RoseNode parseList(String)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | tok = lexer.getNext();↵ | | 1 | tok = lexer.getNext();↵
|
2 | if (tok.getType() != RoseToken.RIGHT_PAREN)↵ | | 2 | if (tok.getType() != RoseToken.↵
|
3 | ↵ | | 3 | STRING)↵
|
4 | {↵ | | 4 | {↵
|
5 | System.out.println(" Parsing error in parseExpr - expecting right parenthesis");↵ | | 5 | System.out.println(" Parsing error in parseList - expecting string");↵
|
6 | return null;↵ | | 6 | return null;↵
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 10.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
23 | tok = lexer.getNext(); | | 15 | tok = lexer.getNext(); |
24 | if (tok.getType() != RoseToken.RIGHT_PAREN) | | 16 | if (tok.getType() != RoseToken.STRING) |
25 | System.out.println(" Parsing error in parseExpr - expecting right parenthesis"); | | 17 | System.out.println(" Parsing error in parseList - expecting string"); |
26 | | | 18 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables tok |