Buffer buffer = view.getBuffer();
try
{
buffer.beginCompoundEdit();
file_loop: for(int i = 0; i < paths.length; i++)
runScript(view,paths[i],false);
}
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 showRunScriptDialog(View)
|
|
Method name: void invokeReadNextChar(char)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 3
|
|
1 | Buffer buffer = view.getBuffer();↵ | | |
|
2 | try↵ | | 1 | try↵
|
3 | {↵ | | 2 | {↵
|
4 | buffer.beginCompoundEdit();↵ | | 3 | buffer.beginCompoundEdit();↵
|
|
5 | file_loop:↵ | | 4 | BeanShell.eval(view,BeanShell.getNameSpace(),↵
|
6 | for(int i = 0; i < paths.length; i++)↵ | | 5 | "for(int i = 1; i < ↵
|
7 | runScript(view,paths[i],false↵ | | 6 | "↵
|
| | | 7 | + getRepeatCount() + "; i++)\n{\n"↵
|
8 | );↵ | | 8 | + readNextChar + "\n}");↵
|
9 | }↵ | | 9 | }↵
|
10 | finally↵ | | 10 | finally↵
|
11 | {↵ | | 11 | {↵
|
12 | buffer.endCompoundEdit();↵ | | 12 | buffer.endCompoundEdit();↵
|
13 | } | | 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.6 |
Clones location | Clones are in different classes |
Number of node comparisons | 7 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
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) | 1.1 |
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(); |
| | | 12 | BeanShell.eval(view, BeanShell.getNameSpace(), "for(int i = 1; i < " + getRepeatCount() + "; i++)\n{\n" + readNextChar + "\n}"); |
Precondition Violations (0)
Row |
Violation |