File path: /jEdit-4.2/src/gnu/regexp/RETokenRepeated.java | File path: /jEdit-4.2/src/gnu/regexp/RETokenRepeated.java | |||
Method name: REMatch matchRest(CharIndexed, REMatch)
|
Method name: boolean match(CharIndexed, REMatch)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | for (current = newMatch; current != null; current = current.next) {↵ | 1 | for (current = newMatch; current != null; current = current.next) {↵ | |
2 | // clone() separates a single match from the chain↵ | 2 | ↵ | |
3 | single = (REMatch) current.clone();↵ | 3 | recurrent = (REMatch) current.clone();↵ | |
4 | if (next(input, single)) {↵ | 4 | if (token.match(input, recurrent)) {↵ | |
5 | // chain results to doneIndex↵ | 5 | ↵ | |
6 | if (doneIndex == null) {↵ | |||
7 | doneIndex = single;↵ | |||
8 | doneIndexLast = single;↵ | |||
9 | } else {↵ | |||
10 | doneIndexLast.next = single;↵ | |||
11 | }↵ | |||
12 | ↵ | 6 | // add all items in current to doables array↵ | |
7 | if (doables == null) {↵ | |||
8 | doables = recurrent;↵ | |||
9 | doablesLast = recurrent;↵ | |||
10 | } else {↵ | |||
11 | // Order these from longest to shortest↵ | |||
12 | // Start by assuming longest (more repeats)↵ | |||
13 | doablesLast.next = recurrent;↵ | |||
14 | }↵ | |||
13 | // Find new doneIndexLast↵ | 15 | // Find new doablesLast↵ | |
14 | while (doneIndexLast.next != null) {↵ | 16 | while (doablesLast.next != null) {↵ | |
15 | doneIndexLast = doneIndexLast.next;↵ | 17 | doablesLast = doablesLast.next;↵ | |
16 | ↵ | 18 | }↵ | |
17 | }↵ | 19 | }↵ | |
18 | }↵ | 20 |
| |
19 | } | |||
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 38 |
Number of mapped statements | 9 |
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) | 128.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | for (current = newMatch; current != null; current = current.next) | 17 | for (current = newMatch; current != null; current = current.next) | |||||||||||||||||||||
5 | single = (REMatch)current.clone(); |
| 18 | recurrent = (REMatch)current.clone(); | ||||||||||||||||||||
6 | if (next(input, single)) |
| 19 | if (token.match(input, recurrent)) | ||||||||||||||||||||
7 | if (doneIndex == null) |
| 20 | if (doables == null) | ||||||||||||||||||||
8 | doneIndex = single; |
| 21 | doables = recurrent; | ||||||||||||||||||||
9 | doneIndexLast = single; |
| 22 | doablesLast = recurrent; | ||||||||||||||||||||
else | else | |||||||||||||||||||||||
10 | doneIndexLast.next = single; |
| 23 | doablesLast.next = recurrent; | ||||||||||||||||||||
11 | while (doneIndexLast.next != null) |
| 24 | while (doablesLast.next != null) | ||||||||||||||||||||
12 | doneIndexLast = doneIndexLast.next; |
| 25 | doablesLast = doablesLast.next; |
Row | Violation |
---|---|
1 | Expression next(input,single) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression token.match(input,recurrent) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression next(input,single) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression token.match(input,recurrent) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables doneIndex , while Clone fragment #2 returns variables doables, current |