if (os != null)
{
try
{
os.close();
}
catch (Exception e)
{
s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(), e);
}
}
try
{
reader.close();
}
catch (Exception e)
{
s_log.error("closeReader: Unable to close FileReader - " + e.getMessage(), e);
}
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/IOUtilitiesImpl.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/IOUtilitiesImpl.java
|
Method name: void closeOutputStream(OutputStream)
|
|
Method name: void closeReader(Reader)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 2
|
|
1 | if (os != null)↵ | | |
|
2 | {↵ | | |
|
3 | try↵ | | 1 | try↵
|
4 | {↵ | | 2 | {↵
|
5 | os.close();↵ | | 3 | reader.close();↵
|
6 | }↵ | | 4 | }↵
|
7 | catch (Exception e)↵ | | 5 | catch (Exception e)↵
|
8 | {↵ | | 6 | {↵
|
9 | s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(), e);↵ | | 7 | s_log.error("closeReader: Unable to close FileReader - " + e.getMessage(), e);↵
|
10 | }↵ | | 8 | }
|
11 | } | | | |
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
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.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | try | | 2 | try |
3 | | | 3 | |
Precondition Violations (0)
Row |
Violation |