File path: /jEdit-4.2/src/org/gjt/sp/jedit/Buffer.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/FileVFS.java | |||
Method name: void close()
|
Method name: void setPermissions(String, int)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | try↵ | 1 | Str↵ | |
2 | ing[] cmdarray = { "chmod", Integer.toString(permissions, 8), path };↵ | |||
3 | try↵ | |||
2 | {↵ | 4 | {↵ | |
3 | waitSocket.getOutputStream().write('\0');↵ | 5 | Process process = Runtime.getRuntime().exec(cmdarray);↵ | |
4 | waitSocket.getOutputStream().flush();↵ | 6 | process.getInputStream().close();↵ | |
5 | waitSocket.getInputStream().close();↵ | 7 | process.getOutputStream().close();↵ | |
6 | waitSocket.getOutputStream().close();↵ | 8 | process.getErrorStream().close();↵ | |
7 | waitSocket.close();↵ | 9 | ↵ | |
8 | }↵ | |||
9 | catch(IOException io)↵ | |||
10 | {↵ | |||
11 | //Log.log(Log.ERROR,this,io);↵ | |||
10 | // Jun 9 2004 12:40 PM↵ | |||
11 | // waitFor() hangs on some Java↵ | |||
12 | // implementations.↵ | |||
13 | /* int exitCode = process.waitFor();↵ | |||
14 | if(exitCode != 0)↵ | |||
15 | Log.log(Log.NOTICE,FileVFS.class,"chmod exited with code " + exitCode); */↵ | |||
16 | }↵ | |||
17 | // Feb 4 2000 5:30 PM↵ | |||
18 | // Catch Throwable here rather than Exception.↵ | |||
19 | // Kaffe's implementation of Runtime.exec throws java.lang.InternalError.↵ | |||
20 | catch (Throwable t)↵ | |||
21 | {↵ | |||
12 | } | 22 | } | |
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 | 31 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 3.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5 | String[] cmdarray = {"chmod", Integer.toString(permissions, 8), path}; | ||||||||||||||||||
5 | try |
| 6 | try | ||||||||||||||||
6 | waitSocket.getOutputStream().write('\0'); |
| | |||||||||||||||||
| 7 | Process process = Runtime.getRuntime().exec(cmdarray); | ||||||||||||||||||
7 | waitSocket.getOutputStream().flush(); |
| | |||||||||||||||||
8 | waitSocket.getInputStream().close(); |
| 8 | process.getInputStream().close(); | ||||||||||||||||
9 | waitSocket.getOutputStream().close(); |
| 9 | process.getOutputStream().close(); | ||||||||||||||||
| 10 | process.getErrorStream().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 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 |
3 | Type java.net.Socket of variable waitSocket does not match with type java.lang.Process of variable process |
4 | Type java.net.Socket of variable waitSocket does not match with type java.lang.Process of variable process |
5 | 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 |