File path: /jEdit-4.2/src/org/gjt/sp/jedit/Macros.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java | |||
Method name: void invoke(View)
|
Method name: void insertEnterAndIndent()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | Buffer buffer = view.getBuffer();↵ | |||
2 | try↵ | 1 | try↵ | |
3 | {↵ | 2 | {↵ | |
4 | buffer.beginCompoundEdit();↵ | 3 | buffer.beginCompoundEdit();↵ | |
5 | handler.runMacro(view,this↵ | 4 | setSelectedText("\n");↵ | |
6 | );↵ | 5 | buffer.indentLine(caretLine,true);↵ | |
7 | }↵ | 6 | }↵ | |
8 | finally↵ | 7 | finally↵ | |
9 | {↵ | 8 | {↵ | |
10 | buffer.endCompoundEdit();↵ | 9 | buffer.endCompoundEdit();↵ | |
11 | } | 10 | } | |
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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 3 |
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) | 546.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | Buffer buffer = view.getBuffer(); | | ||||||||||||||||||||||||
4 | try | 3 | try | |||||||||||||||||||||||
5 | buffer.beginCompoundEdit(); | 4 | buffer.beginCompoundEdit(); | |||||||||||||||||||||||
6 | handler.runMacro(view, this); |
| 5 | setSelectedText("\n"); | ||||||||||||||||||||||
|
| 6 | buffer.indentLine(caretLine, true); |
Row | Violation |
---|---|
1 | Expression setSelectedText("\n") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression handler.runMacro(view,this) is a void method call, and thus it cannot be parameterized |
3 | Expression setSelectedText("\n") is a void method call, and thus it cannot be parameterized |
4 | Expression setSelectedText("\n") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression handler.runMacro(view,this) is a void method call, and thus it cannot be parameterized |
6 | Expression setSelectedText("\n") is a void method call, and thus it cannot be parameterized |
7 | Unmatched statement buffer.indentLine(caretLine,true); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |