File path: /jEdit-4.2/src/gnu/regexp/RETokenRepeated.java | File path: /jEdit-4.2/src/gnu/regexp/RETokenRepeated.java | |||
Method name: boolean match(CharIndexed, REMatch)
|
Method name: boolean match(CharIndexed, REMatch)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 9 | |||
1 | while (--posIndex >= min) {↵ | |||
2 | newMatch = (REMatch) positions.elementAt(posIndex);↵ | |||
3 | results = ↵ | 1 | for (current = newMatch; current != null; current = current.next) {↵ | |
2 | recurrent = (REMatch) current.clone();↵ | |||
4 | matchRest(input, newMatch);↵ | 3 | if (token.match(input, ↵ | |
5 | if (results != null) {↵ | |||
6 | if (allResult↵ | 4 | recurrent)) {↵ | |
5 | // add all items in current to doables array↵ | |||
7 | s == null) {↵ | 6 | if (doables == null) {↵ | |
8 | allResults = results;↵ | 7 | ↵ | |
9 | allResultsLast = results;↵ | |||
10 | ↵ | 8 | doables = recurrent;↵ | |
9 | doablesLast = recurrent;↵ | |||
11 | } else {↵ | 10 | } else {↵ | |
12 | // Order these from longest to shortest↵ | 11 | // Order these from longest to shortest↵ | |
13 | // Start by assuming longest (more repeats)↵ | 12 | // Start by assuming longest (more repeats)↵ | |
14 | allResultsLast.next = results;↵ | 13 | ↵ | |
15 | }↵ | |||
16 | ↵ | 14 | doablesLast.next = recurrent;↵ | |
15 | }↵ | |||
17 | // Find new doablesLast↵ | 16 | // Find new doablesLast↵ | |
18 | while (allResultsLast.next != null) {↵ | 17 | while (doablesLast.next != null) {↵ | |
19 | allResultsLast = allResultsLast.next;↵ | 18 | doablesLast = doablesLast.next;↵ | |
20 | }↵ | 19 | ↵ | |
21 | }↵ | 20 | }↵ | |
22 | ↵ | 21 | }↵ | |
23 | // else did not match rest of the tokens, try again on smaller sample↵ | 22 | ↵ | |
24 | } | 23 |
| |
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) | 1.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 35 |
Number of mapped statements | 6 |
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) | 4.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42 | if (allResults == null) |
| 20 | if (doables == null) | |||||||||||||
43 | allResults = results; |
| 21 | doables = recurrent; | |||||||||||||
44 | allResultsLast = results; |
| 22 | doablesLast = recurrent; | |||||||||||||
else | else | ||||||||||||||||
45 | allResultsLast.next = results; |
| 23 | doablesLast.next = recurrent; | |||||||||||||
46 | while (allResultsLast.next != null) |
| 24 | while (doablesLast.next != null) | |||||||||||||
47 | allResultsLast = allResultsLast.next; |
| 25 | doablesLast = doablesLast.next; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables allResults, allResultsLast , while Clone fragment #2 returns variables doables, doablesLast |