File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java | |||
Method name: void assertEqualContent(File, File)
|
Method name: void assertEqualContent(File, File)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | if (!result.exists()) {↵ | 1 | if (!result.exists()) {↵ | |
2 | fail("Expected file "+result+" doesn\'t exist");↵ | 2 | fail("Expected file "+result+" doesn\'t exist");↵ | |
3 | }↵ | 3 | }↵ | |
4 | InputStream inExpect = null;↵ | 4 | InputStream inExpect = null;↵ | |
5 | InputStream inResult = null;↵ | 5 | InputStream inResult = null;↵ | |
6 | try {↵ | 6 | try {↵ | |
7 | inExpect = new BufferedInputStream(new FileInputStream(expect));↵ | 7 | inExpect = new BufferedInputStream(new FileInputStream(expect));↵ | |
8 | inResult = new BufferedInputStream(new FileInputStream(result));↵ | 8 | inResult = new BufferedInputStream(new FileInputStream(result));↵ | |
9 | int expectedByte = inExpect.read();↵ | 9 | int expectedByte = inExpect.read();↵ | |
10 | while (expectedByte != -1) {↵ | 10 | while (expectedByte != -1) {↵ | |
11 | assertEquals(expectedByte, inResult.read());↵ | 11 | assertEquals(expectedByte, inResult.read());↵ | |
12 | expectedByte = inExpect.read();↵ | 12 | expectedByte = inExpect.read();↵ | |
13 | }↵ | 13 | }↵ | |
14 | assertEquals("End of file", -1, inResult.read());↵ | 14 | assertEquals("End of file", -1, inResult.read());↵ | |
15 | } finally {↵ | 15 | } finally {↵ | |
16 | if (inResult != null) {↵ | 16 | if (inResult != null) {↵ | |
17 | inResult.close();↵ | 17 | inResult.close();↵ | |
18 | }↵ | 18 | }↵ | |
19 | if (inExpect != null) {↵ | 19 | if (inExpect != null) {↵ | |
20 | inExpect.close();↵ | 20 | inExpect.close();↵ | |
21 | }↵ | 21 | }↵ | |
22 | } | 22 |
| |
See real code fragment | See real code fragment |
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.6 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 42 |
Number of mapped statements | 12 |
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) | 4.3 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | if (!result.exists()) | 1 | if (!result.exists()) | |
2 | fail("Expected file " + result + " doesn\'t exist"); | 2 | fail("Expected file " + result + " doesn\'t exist"); | |
3 | InputStream inExpect = null; | 3 | InputStream inExpect = null; | |
4 | InputStream inResult = null; | 4 | InputStream inResult = null; | |
5 | try | 5 | try | |
6 | inExpect = new BufferedInputStream(new FileInputStream(expect)); | 6 | inExpect = new BufferedInputStream(new FileInputStream(expect)); | |
7 | inResult = new BufferedInputStream(new FileInputStream(result)); | 7 | inResult = new BufferedInputStream(new FileInputStream(result)); | |
8 | int expectedByte = inExpect.read(); | 8 | int expectedByte = inExpect.read(); | |
9 | while (expectedByte != -1) | 9 | while (expectedByte != -1) | |
10 | assertEquals(expectedByte, inResult.read()); | 10 | assertEquals(expectedByte, inResult.read()); | |
11 | expectedByte = inExpect.read(); | 11 | expectedByte = inExpect.read(); | |
12 | assertEquals("End of file", -1, inResult.read()); | 12 | assertEquals("End of file", -1, inResult.read()); |
Row | Violation |
---|