File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/PropertyFile.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java | |||
Method name: void readFile()
|
Method name: void registerTestCase(String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 6 | |||
1 | log("Creating new property file: "↵ | |||
2 | + propertyfile.getAbsolutePath());↵ | |||
3 | FileOutputStream↵ | 1 | try {↵ | |
4 | out = null;↵ | 2 | FileWriter out = null;↵ | |
5 | try {↵ | 3 | try {↵ | |
6 | out = new FileOutputStream(propertyfile.getAbsolutePath()↵ | 4 | out = new FileWriter(crashFile);↵ | |
7 | );↵ | 5 | out.write(testCase + "\n");↵ | |
8 | out.flush();↵ | 6 | out.flush();↵ | |
9 | } finally {↵ | 7 | } finally {↵ | |
10 | if (out != null) {↵ | 8 | if (out != null) {↵ | |
11 | out.close();↵ | 9 | out.close();↵ | |
12 | }↵ | 10 | }↵ | |
13 | } | 11 | }↵ | |
12 | } catch (IOException e) {↵ | |||
13 | // ignored.↵ | |||
14 |
| |||
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 | 14 |
Number of mapped statements | 2 |
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) | 0.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | log("Creating new property file: " + propertyfile.getAbsolutePath()); | | |||||||||||||||||
11 | FileOutputStream out = null; | | |||||||||||||||||
12 | try |
| 4 | try | |||||||||||||||
| 5 | out = new FileWriter(crashFile); | |||||||||||||||||
|
| 6 | out.write(testCase + "\n"); | ||||||||||||||||
13 | out = new FileOutputStream(propertyfile.getAbsolutePath()); | | |||||||||||||||||
14 | out.flush(); |
| 7 | out.flush(); |
Row | Violation |
---|---|
1 | Type java.io.FileOutputStream of variable out does not match with type java.io.FileWriter of variable out |
2 | Type java.io.FileOutputStream of variable out does not match with type java.io.FileWriter of variable out |
3 | Unmatched statement out.write(testCase + "\n"); 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 | Type java.io.FileOutputStream of variable out does not match with type java.io.FileWriter of variable out |