File path: /jEdit-4.2/src/installer/OperatingSystem.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/Buffer.java | |||
Method name: void exec(String[])
|
Method name: void close()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | Process proc = Runtime.getRuntime().exec(args);↵ | |||
2 | proc↵ | 1 | try↵ | |
2 | {↵ | |||
3 | waitSocket.getOutputStream().write('\0');↵ | |||
3 | .getInputStream().close();↵ | 4 | waitSocket.getOutputStream().flush();↵ | |
4 | proc.getOutputStream().close();↵ | 5 | waitSocket.getInputStream().close();↵ | |
5 | proc.getErrorStream().close();↵ | 6 | waitSocket.getOutputStream().close();↵ | |
6 | try↵ | 7 | ↵ | |
7 | {↵ | |||
8 | proc.waitFor();↵ | 8 | waitSocket.close();↵ | |
9 | }↵ | 9 | }↵ | |
10 | catch(InterruptedException ie)↵ | 10 | catch(IOException io)↵ | |
11 | {↵ | 11 | {↵ | |
12 | ↵ | 12 | //Log.log(Log.ERROR,this,io);↵ | |
13 | } | 13 | } | |
See real code fragment | See real code fragment |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Process proc = Runtime.getRuntime().exec(args); | | ||||||||||||||||||
2 | proc.getInputStream().close(); | | ||||||||||||||||||
3 | proc.getOutputStream().close(); | | ||||||||||||||||||
4 | proc.getErrorStream().close(); | | ||||||||||||||||||
5 | try |
| 5 | try | ||||||||||||||||
|
| 6 | waitSocket.getOutputStream().write('\0'); | |||||||||||||||||
6 | proc.waitFor(); |
| | |||||||||||||||||
|
| 7 | waitSocket.getOutputStream().flush(); | |||||||||||||||||
|
| 8 | waitSocket.getInputStream().close(); | |||||||||||||||||
|
| 9 | waitSocket.getOutputStream().close(); | |||||||||||||||||
|
| 10 | waitSocket.close(); |
Row | Violation |
---|---|
1 | Unmatched statement waitSocket.getOutputStream().write('\0'); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
2 | Unmatched statement proc.waitFor(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched statement waitSocket.getOutputStream().flush(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | Unmatched statement waitSocket.getInputStream().close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
5 | Unmatched statement waitSocket.getOutputStream().close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
6 | Unmatched statement waitSocket.close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |