path = vfs._canonPath(session,path,view);
VFS.DirectoryEntry entry = vfs._getDirectoryEntry(
session,path,view);
long length;
if(entry != null)
length = entry.length;
else
length = 0L;
in = vfs._createInputStream(session,path,
false,view);
if(in == null)
return;
path = vfs._canonPath(session,path,view);
VFS.DirectoryEntry entry = vfs._getDirectoryEntry(
session,path,view);
long length;
if(entry != null)
length = entry.length;
else
length = 0L;
in = vfs._createInputStream(session,path,false,view);
if(in == null)
return;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/BufferIORequest.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/BufferIORequest.java
|
Method name: void load()
|
|
Method name: void insert()
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | path = vfs._canonPath(session,path,view);↵ | | 1 | path = vfs._canonPath(session,path,view);↵
|
|
2 | VFS.DirectoryEntry entry = vfs._getDirectoryEntry(↵ | | 2 | VFS.DirectoryEntry entry = vfs._getDirectoryEntry(↵
|
3 | session,path,view);↵ | | 3 | session,path,view);↵
|
4 | long length;↵ | | 4 | long length;↵
|
5 | if(entry != null)↵ | | 5 | if(entry != null)↵
|
6 | length = entry.length;↵ | | 6 | length = entry.length;↵
|
7 | else↵ | | 7 | else↵
|
8 | length = 0L;↵ | | 8 | length = 0L;↵
|
|
9 | in = vfs._createInputStream(session,path,↵ | | 9 | in = vfs._createInputStream(session,path,↵
|
10 | false,view);↵ | | 10 | false,view);↵
|
11 | if(in == null)↵ | | 11 | if(in == null)↵
|
12 | return; | | 12 | return;
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 31 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 9 |
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.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
9 | path = vfs._canonPath(session, path, view); | | 7 | path = vfs._canonPath(session, path, view); |
10 | VFS.DirectoryEntry entry = vfs._getDirectoryEntry(session, path, view); | | 8 | VFS.DirectoryEntry entry = vfs._getDirectoryEntry(session, path, view); |
11 | long length; | | 9 | long length; |
12 | if (entry != null) | | 10 | if (entry != null) |
13 | | | 11 | |
| | | | |
14 | | | 12 | |
15 | in = vfs._createInputStream(session, path, false, view); | | 13 | in = vfs._createInputStream(session, path, false, view); |
16 | if (in == null) | | 14 | if (in == null) |
17 | | | 15 | |
Precondition Violations (3)
Row |
Violation |
1 | Conditional return; |
2 | Conditional return; |
3 | Clone fragment #1 returns variables length, in , while Clone fragment #2 returns variables length, in |