String canonPath;
try
{
canonPath = file.getCanonicalPath();
}
catch(IOException io)
{
canonPath = path;
}
boolean retVal = file.delete();
String canonPath;
try
{
canonPath = file.getCanonicalPath();
}
catch(IOException io)
{
canonPath = directory;
}
VFSManager.sendVFSUpdate(this,canonPath,true);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/FileVFS.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/FileVFS.java
|
Method name: boolean _delete(Object, String, Component)
|
|
Method name: boolean _mkdir(Object, String, Component)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | String canonPath;↵ | | 1 | String canonPath;↵
|
2 | try↵ | | 2 | try↵
|
3 | {↵ | | 3 | {↵
|
4 | canonPath = file.getCanonicalPath();↵ | | 4 | canonPath = file.getCanonicalPath();↵
|
5 | }↵ | | 5 | }↵
|
6 | catch(IOException io)↵ | | 6 | catch(IOException io)↵
|
7 | {↵ | | 7 | {↵
|
8 | canonPath = path;↵ | | 8 | canonPath = directory;↵
|
9 | }↵ | | 9 | }↵
|
|
10 | boolean retVal = file.delete(); | | 10 | VFSManager.sendVFSUpdate(this,canonPath,true);
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
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) | 0.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | String canonPath; | | 7 | String canonPath; |
3 | try | | 8 | try |
4 | canonPath = file.getCanonicalPath(); | | 9 | canonPath = file.getCanonicalPath(); |
5 | boolean retVal = file.delete(); | | | |
| | | 10 | VFSManager.sendVFSUpdate(this, canonPath, true); |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched statement boolean retVal=file.delete(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |