Buffer buffer = view.getBuffer();
try
{
buffer.beginCompoundEdit();
handler.runMacro(view,this);
}
finally
{
buffer.endCompoundEdit();
}
try
{
buffer.beginCompoundEdit();
BeanShell.eval(view,BeanShell.getNameSpace(),
"for(int i = 1; i < "
+ getRepeatCount() + "; i++)\n{\n"
+ readNextChar + "\n}");
}
finally
{
buffer.endCompoundEdit();
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/Macros.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/InputHandler.java
|
Method name: void invoke(View)
|
|
Method name: void invokeReadNextChar(char)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 3
|
|
1 | Buffer buffer = view.getBuffer();↵ | | |
|
|
2 | try↵ | | 1 | try↵
|
3 | {↵ | | 2 | {↵
|
4 | buffer.beginCompoundEdit();↵ | | 3 | buffer.beginCompoundEdit();↵
|
5 | ↵ | | |
|
6 | handler.runMacro(view,this);↵ | | 4 | ↵
|
7 | }↵ | | |
|
8 | ↵ | | 5 | BeanShell.eval(view,BeanShell.getNameSpace(),↵
|
| | | 6 | "for(int i = 1; i < "↵
|
| | | 7 | + getRepeatCount() + "; i++)\n{\n"↵
|
| | | 8 | + readNextChar + "\n}");↵
|
| | | 9 | }↵
|
9 | finally↵ | | 10 | finally↵
|
10 | {↵ | | 11 | {↵
|
11 | buffer.endCompoundEdit();↵ | | 12 | buffer.endCompoundEdit();↵
|
12 | } | | 13 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | Buffer buffer = view.getBuffer(); | | | |
4 | try | | 10 | try |
5 | buffer.beginCompoundEdit(); | | 11 | buffer.beginCompoundEdit(); |
6 | handler.runMacro(view, this); | | | |
| | | 12 | BeanShell.eval(view, BeanShell.getNameSpace(), "for(int i = 1; i < " + getRepeatCount() + "; i++)\n{\n" + readNextChar + "\n}"); |
Precondition Violations (0)
Row |
Violation |