try
{
return new URL(path).openStream();
}
catch(MalformedURLException mu)
{
Log.log(Log.ERROR,this,mu);
String[] args = { mu.getMessage() };
VFSManager.error(comp,path,"ioerror.badurl",args);
return null;
}
try
{
return new URL(path).openConnection()
.getOutputStream();
}
catch(MalformedURLException mu)
{
Log.log(Log.ERROR,this,mu);
String[] args = { mu.getMessage() };
VFSManager.error(comp,path,"ioerror.badurl",args);
return null;
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/UrlVFS.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/UrlVFS.java
|
Method name: InputStream _createInputStream(Object, String, boolean, Component)
|
|
Method name: OutputStream _createOutputStream(Object, String, Component)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 2
|
|
1 | try↵ | | 1 | try↵
|
2 | {↵ | | 2 | {↵
|
3 | return new URL(path).open↵ | | 3 | return new URL(path).openConnection()↵
|
4 | Stream();↵ | | 4 | .getOutputStream();↵
|
5 | }↵ | | 5 | }↵
|
6 | catch(MalformedURLException mu)↵ | | 6 | catch(MalformedURLException mu)↵
|
7 | {↵ | | 7 | {↵
|
8 | Log.log(Log.ERROR,this,mu);↵ | | 8 | Log.log(Log.ERROR,this,mu);↵
|
9 | String[] args = { mu.getMessage() };↵ | | 9 | String[] args = { mu.getMessage() };↵
|
10 | VFSManager.error(comp,path,"ioerror.badurl",args);↵ | | 10 | VFSManager.error(comp,path,"ioerror.badurl",args);↵
|
11 | return null;↵ | | 11 | return null;↵
|
12 | } | | 12 | }
|
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 4 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
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.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 1 | try |
| | | 2 | return new URL(path).openConnection().getOutputStream(); |
2 | return new URL(path).openStream(); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched return new URL(path).openConnection().getOutputStream(); |
2 | Unmatched return new URL(path).openStream(); |