try
{
setAbortable(true);
String[] args = { path1 };
setStatus(jEdit.getProperty("vfs.status.deleting",args));
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);
}
}
catch(WorkThread.Abort a)
{
}
finally
{
try
{
vfs._endVFSSession(session,browser);
}
catch(IOException io)
{
setAbortable(false);
Log.log(Log.ERROR,this,io);
String[] pp = { io.toString() };
VFSManager.error(browser,path1,"ioerror.directory-error",pp);
}
}
try
{
setAbortable(true);
String[] args = { path1 };
setStatus(jEdit.getProperty("vfs.status.mkdir",args));
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);
}
}
catch(WorkThread.Abort a)
{
}
finally
{
try
{
vfs._endVFSSession(session,browser);
}
catch(IOException io)
{
setAbortable(false);
Log.log(Log.ERROR,this,io);
String[] args = { 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: 8
|
|
Number of AST nodes: 8
|
|
1 | try↵ | | 1 | try↵
|
2 | {↵ | | 2 | {↵
|
3 | setAbortable(true);↵ | | 3 | setAbortable(true);↵
|
4 | String[] args = { path1 };↵ | | 4 | String[] args = { path1 };↵
|
5 | setStatus(jEdit.getProperty("vfs.status.deleting",args));↵ | | 5 | setStatus(jEdit.getProperty("vfs.status.mkdir",args));↵
|
|
6 | try↵ | | 6 | try↵
|
7 | {↵ | | 7 | {↵
|
8 | path1 = vfs._canonPath(session,path1,browser);↵ | | 8 | path1 = vfs._canonPath(session,path1,browser);↵
|
|
|
9 | if(!vfs._delete(session,path1,browser))↵ | | 9 | if(!vfs._mkdir(session,path1,browser))↵
|
10 | VFSManager.error(browser,path1,"ioerror.delete-error",null);↵ | | 10 | VFSManager.error(browser,path1,"ioerror.mkdir-error",null);↵
|
11 | }↵ | | 11 | }↵
|
12 | catch(IOException io)↵ | | 12 | catch(IOException io)↵
|
13 | {↵ | | 13 | {↵
|
14 | setAbortable(false);↵ | | 14 | setAbortable(false);↵
|
15 | Log.log(Log.ERROR,this,io);↵ | | 15 | Log.log(Log.ERROR,this,io);↵
|
16 | String[] pp = { io.toString() };↵ | | 16 | args[0] = io.toString();↵
|
17 | VFSManager.error(browser,path1,"ioerror.directory-error",pp);↵ | | 17 | VFSManager.error(browser,path1,"ioerror",args);↵
|
18 | }↵ | | 18 | }↵
|
19 | }↵ | | 19 | }↵
|
20 | catch(WorkThread.Abort a)↵ | | 20 | catch(WorkThread.Abort a)↵
|
21 | {↵ | | 21 | {↵
|
22 | }↵ | | 22 | }↵
|
23 | finally↵ | | 23 | finally↵
|
24 | {↵ | | 24 | {↵
|
25 | try↵ | | 25 | try↵
|
26 | {↵ | | 26 | {↵
|
27 | vfs._endVFSSession(session,browser);↵ | | 27 | vfs._endVFSSession(session,browser);↵
|
28 | }↵ | | 28 | }↵
|
29 | catch(IOException io)↵ | | 29 | catch(IOException io)↵
|
30 | {↵ | | 30 | {↵
|
31 | setAbortable(false);↵ | | 31 | setAbortable(false);↵
|
32 | Log.log(Log.ERROR,this,io);↵ | | 32 | Log.log(Log.ERROR,this,io);↵
|
33 | String[] pp = { io.toString() };↵ | | 33 | String[] args = { io.toString() };↵
|
34 | VFSManager.error(browser,path1,"ioerror.directory-error",pp);↵ | | 34 | VFSManager.error(browser,path1,"ioerror",args);↵
|
35 | }↵ | | 35 | }↵
|
36 | } | | 36 | }
|
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) | 1.4 |
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) | 1.9 |
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 |