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 parseObject(String)
|
Method name: RoseNode parseValue(String)
|
|||
Number of AST nodes: 18 | Number of AST nodes: 18 | |||
1 | Integer topInt = idStack.pop();↵ | 1 | Integer topInt = idStack.pop();↵ | |
2 | int top = topInt.intValue();↵ | 2 | int top = topInt.intValue();↵ | |
3 | // top++;↵ | |||
3 | idStack.push(new Integer(++top));↵ | 4 | idStack.push(new Integer(++top));↵ | |
4 | idStack.push(new Integer(0));↵ | 5 | idStack.push(new Integer(0));↵ | |
5 | if (baseId == null)↵ | 6 | if (baseId == null)↵ | |
6 | {↵ | 7 | {↵ | |
7 | baseId = "id";↵ | 8 | baseId = "id";↵ | |
8 | }↵ | 9 | }↵ | |
9 | else↵ | 10 | else↵ | |
10 | {↵ | 11 | {↵ | |
11 | baseId += ".";↵ | 12 | baseId += ".";↵ | |
12 | baseId += topInt.toString();↵ | 13 | baseId += topInt.toString();↵ | |
13 | }↵ | 14 | }↵ | |
14 | RoseToken tok = lexer.getNext();↵ | 15 | RoseToken tok = lexer.getNext();↵ | |
15 | if (tok.getType() != RoseToken.OBJECT)↵ | 16 | if (tok.getType() != RoseToken.VALUE)↵ | |
16 | {↵ | 17 | {↵ | |
17 | System.out.println(" Parsing error in parseObject - expecting object token");↵ | 18 | System.out.println(" Parsing error in parseValue - expecting value token");↵ | |
18 | return null;↵ | 19 | return null;↵ | |
19 | }↵ | 20 | }↵ | |
20 | tok = lexer.getNext();↵ | 21 | tok = lexer.getNext();↵ | |
21 | if (tok.getType() != RoseToken.STRING)↵ | 22 | if (tok.getType() != RoseToken.STRING)↵ | |
22 | {↵ | 23 | {↵ | |
23 | System.out.println(" Parsing error in parseObject - expecting string");↵ | 24 | System.out.println(" Parsing error in parseValue - expecting string");↵ | |
24 | return null;↵ | 25 | return null;↵ | |
25 | }↵ | 26 | }↵ | |
26 | String label = tok.getValue();↵ | 27 | String label = tok.getValue();↵ | |
27 | RoseNode root = null; | 28 |
| |
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.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 134 |
Number of mapped statements | 18 |
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.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Integer topInt = idStack.pop(); | 1 | Integer topInt = idStack.pop(); | |||||||||||
2 | int top = topInt.intValue(); | 2 | int top = topInt.intValue(); | |||||||||||
3 | idStack.push(new Integer(++top)); | 3 | idStack.push(new Integer(++top)); | |||||||||||
4 | idStack.push(new Integer(0)); | 4 | idStack.push(new Integer(0)); | |||||||||||
5 | if (baseId == null) | 5 | if (baseId == null) | |||||||||||
6 | baseId = "id"; | 6 | baseId = "id"; | |||||||||||
else | else | |||||||||||||
7 | baseId += "."; | 7 | baseId += "."; | |||||||||||
8 | baseId += topInt.toString(); | 8 | baseId += topInt.toString(); | |||||||||||
9 | RoseToken tok = lexer.getNext(); | 9 | RoseToken tok = lexer.getNext(); | |||||||||||
10 | if (tok.getType() != RoseToken.OBJECT) |
| 10 | if (tok.getType() != RoseToken.VALUE) | ||||||||||
11 | System.out.println(" Parsing error in parseObject - expecting object token"); |
| 11 | System.out.println(" Parsing error in parseValue - expecting value token"); | ||||||||||
12 | return null; | 12 | return null; | |||||||||||
13 | tok = lexer.getNext(); | 13 | tok = lexer.getNext(); | |||||||||||
14 | if (tok.getType() != RoseToken.STRING) | 14 | if (tok.getType() != RoseToken.STRING) | |||||||||||
15 | System.out.println(" Parsing error in parseObject - expecting string"); |
| 15 | System.out.println(" Parsing error in parseValue - expecting string"); | ||||||||||
16 | return null; | 16 | return null; | |||||||||||
17 | String label = tok.getValue(); | 17 | String label = tok.getValue(); | |||||||||||
18 | RoseNode root = null; | 18 | RoseNode root = null; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables label, root , while Clone fragment #2 returns variables label, root |