File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/UndoManager.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/UndoManager.java | |||
Method name: int undo()
|
Method name: int redo()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | if(insideCompoundEdit())↵ | 1 | if(insideCompoundEdit())↵ | |
2 | throw new InternalError("Unbalanced begin/endCompoundEdit()");↵ | 2 | throw new InternalError("Unbalanced begin/endCompoundEdit()");↵ | |
3 | if(undosLast == null)↵ | 3 | if(redosFirst == null)↵ | |
4 | return -1;↵ | 4 | return -1;↵ | |
5 | else↵ | 5 | else↵ | |
6 | {↵ | 6 | {↵ | |
7 | undoCount--;↵ | 7 | undoCount++;↵ | |
8 | int caret = undosLast.undo();↵ | 8 | int caret = ↵ | |
9 | redosFirst = undosLast;↵ | 9 | redosFirst.redo();↵ | |
10 | undosLast = undosLast.prev;↵ | 10 | undosLast = redosFirst;↵ | |
11 | if(undosLast == null)↵ | 11 | if(undosFirst == null)↵ | |
12 | undosFirst = null↵ | 12 | undosFirst = undosLast;↵ | |
13 | ;↵ | 13 | redosFirst = redosFirst.next;↵ | |
14 | return caret;↵ | 14 | return caret;↵ | |
15 | } | 15 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 72 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (insideCompoundEdit()) | 1 | if (insideCompoundEdit()) | |||||||||||||||||||
2 | throw new InternalError("Unbalanced begin/endCompoundEdit()"); | 2 | throw new InternalError("Unbalanced begin/endCompoundEdit()"); | |||||||||||||||||||
3 | if (undosLast == null) |
| 3 | if (redosFirst == null) | ||||||||||||||||||
4 | return -1; | 4 | return -1; | |||||||||||||||||||
else | else | |||||||||||||||||||||
| 5 | undoCount++; | ||||||||||||||||||||
5 | undoCount--; | | ||||||||||||||||||||
6 | int caret = undosLast.undo(); |
| 6 | int caret = redosFirst.redo(); | ||||||||||||||||||
7 | redosFirst = undosLast; |
| 7 | undosLast = redosFirst; | ||||||||||||||||||
8 | undosLast = undosLast.prev; |
| 10 | redosFirst = redosFirst.next; | ||||||||||||||||||
9 | if (undosLast == null) |
| 8 | if (undosFirst == null) | ||||||||||||||||||
10 | undosFirst = null; |
| 9 | undosFirst = undosLast; | ||||||||||||||||||
11 | return caret; | 11 | return caret; |
Row | Violation |
---|---|
1 | Expression redosFirst is a field being modified, and thus it cannot be parameterized |
2 | Expression undosLast is a field being modified, and thus it cannot be parameterized |
3 | Expression undosLast is a field being modified, and thus it cannot be parameterized |
4 | Expression redosFirst is a field being modified, and thus it cannot be parameterized |
5 | Expression undosLast cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression undosLast cannot be parameterized, because it has dependencies to/from statements that will be extracted |