if(waitSocket != null)
{
try
{
waitSocket.getOutputStream().write('\0');
waitSocket.getOutputStream().flush();
waitSocket.getInputStream().close();
waitSocket.getOutputStream().close();
waitSocket.close();
}
catch(IOException io)
{
//Log.log(Log.ERROR,this,io);
}
}
if(waitSocket != null)
{
try
{
waitSocket.getOutputStream().write('\0');
waitSocket.getOutputStream().flush();
waitSocket.getInputStream().close();
waitSocket.getOutputStream().close();
waitSocket.close();
}
catch(IOException io)
{
//Log.log(Log.ERROR,this,io);
}
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/Buffer.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/View.java
|
Method name: void close()
|
|
Method name: void close()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if(waitSocket != null)↵ | | 1 | if(waitSocket != null)↵
|
2 | {↵ | | 2 | {↵
|
3 | try↵ | | 3 | try↵
|
4 | {↵ | | 4 | {↵
|
5 | waitSocket.getOutputStream().write('\0');↵ | | 5 | waitSocket.getOutputStream().write('\0');↵
|
6 | waitSocket.getOutputStream().flush();↵ | | 6 | waitSocket.getOutputStream().flush();↵
|
7 | waitSocket.getInputStream().close();↵ | | 7 | waitSocket.getInputStream().close();↵
|
8 | waitSocket.getOutputStream().close();↵ | | 8 | waitSocket.getOutputStream().close();↵
|
9 | waitSocket.close();↵ | | 9 | waitSocket.close();↵
|
10 | }↵ | | 10 | }↵
|
11 | catch(IOException io)↵ | | 11 | catch(IOException io)↵
|
12 | {↵ | | 12 | {↵
|
13 | //Log.log(Log.ERROR,this,io);↵ | | 13 | //Log.log(Log.ERROR,this,io);↵
|
14 | }↵ | | 14 | }↵
|
15 | } | | 15 | }
|
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 37 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 3.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | if (waitSocket != null) | | 16 | if (waitSocket != null) |
5 | | | 17 | |
6 | waitSocket.getOutputStream().write('\0'); | | 18 | waitSocket.getOutputStream().write('\0'); |
7 | waitSocket.getOutputStream().flush(); | | 19 | waitSocket.getOutputStream().flush(); |
8 | waitSocket.getInputStream().close(); | | 20 | waitSocket.getInputStream().close(); |
9 | waitSocket.getOutputStream().close(); | | 21 | waitSocket.getOutputStream().close(); |
10 | | | 22 | |
Precondition Violations (0)
Row |
Violation |