try
{
path1 = vfs._canonPath(session,path1,browser);
if(!vfs._delete(session,path1,browser))
VFSManager.error(browser,path1,"ioerror.delete-error",null);
}
catch(IOException io)
{
setAbortable(false);
Log.log(Log.ERROR,this,io);
String[] pp = { io.toString() };
VFSManager.error(browser,path1,"ioerror.directory-error",pp);
}
try
{
path1 = vfs._canonPath(session,path1,browser);
if(!vfs._mkdir(session,path1,browser))
VFSManager.error(browser,path1,"ioerror.mkdir-error",null);
}
catch(IOException io)
{
setAbortable(false);
Log.log(Log.ERROR,this,io);
args[0] = io.toString();
VFSManager.error(browser,path1,"ioerror",args);
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/browser/BrowserIORequest.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/browser/BrowserIORequest.java
|
Method name: void delete()
|
|
Method name: void mkdir()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | try↵ | | 1 | try↵
|
2 | {↵ | | 2 | {↵
|
3 | path1 = vfs._canonPath(session,path1,browser);↵ | | 3 | path1 = vfs._canonPath(session,path1,browser);↵
|
|
|
4 | if(!vfs._delete(session,path1,browser))↵ | | 4 | if(!vfs._mkdir(session,path1,browser))↵
|
5 | VFSManager.error(browser,path1,"ioerror.delete-error",null);↵ | | 5 | VFSManager.error(browser,path1,"ioerror.mkdir-error",null);↵
|
6 | }↵ | | 6 | }↵
|
7 | catch(IOException io)↵ | | 7 | catch(IOException io)↵
|
8 | {↵ | | 8 | {↵
|
9 | setAbortable(false);↵ | | 9 | setAbortable(false);↵
|
10 | Log.log(Log.ERROR,this,io);↵ | | 10 | Log.log(Log.ERROR,this,io);↵
|
11 | String[] pp = { io.toString() };↵ | | 11 | args[0] = io.toString();↵
|
12 | VFSManager.error(browser,path1,"ioerror.directory-error",pp);↵ | | 12 | VFSManager.error(browser,path1,"ioerror",args);↵
|
13 | } | | 13 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 declared in the same class |
Number of node comparisons | 6 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | path1 = vfs._canonPath(session, path1, browser); | | 6 | path1 = vfs._canonPath(session, path1, browser); |
7 | if (!vfs._delete(session, path1, browser)) | | 7 | if (!vfs._mkdir(session, path1, browser)) |
8 | VFSManager.error(browser, path1, "ioerror.delete-error", null); | | 8 | VFSManager.error(browser, path1, "ioerror.mkdir-error", null); |
Precondition Violations (2)
Row |
Violation |
1 | Expression vfs._delete(session,path1,browser) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression vfs._mkdir(session,path1,browser) cannot be parameterized, because it has dependencies to/from statements that will be extracted |