void testTabInLiteralInComment() { executeTarget("testTabInLiteralInComment"); } // not used, but public so theoretically must remain for BC? public void assertEqualContent(File expect, File result) throws AssertionFailedError, IOException { if (!result.exists()) { fail("Expected file "+result+" doesn\'t exist"); } InputStream inExpect = null; InputStream inResult = null; try { inExpect = new BufferedInputStream(new FileInputStream(expect)); inResult = new BufferedInputStream(new FileInputStream(result)); int expectedByte = inExpect.read(); while (expectedByte != -1) { assertEquals(expectedByte, inResult.read()); expectedByte = inExpect.read(); } assertEquals("End of file", -1, inResult.read()); } finally { if (inResult != null) { inResult.close(); } if (inExpect != null) { inExpect.close(); } }
void tearDown() { executeTarget("cleanup"); } public void assertEqualContent(File expect, File result) throws AssertionFailedError, IOException { if (!result.exists()) { fail("Expected file "+result+" doesn\'t exist"); } InputStream inExpect = null; InputStream inResult = null; try { inExpect = new BufferedInputStream(new FileInputStream(expect)); inResult = new BufferedInputStream(new FileInputStream(result)); int expectedByte = inExpect.read(); while (expectedByte != -1) { assertEquals(expectedByte, inResult.read()); expectedByte = inExpect.read(); } assertEquals("End of file", -1, inResult.read()); } finally { if (inResult != null) { inResult.close(); } if (inExpect != null) { inExpect.close(); } }
Clone fragments detected by clone detection tool
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testTabInLiteralInComment() {
1
void tearDown() {
2
        executeTarget("testTabInLiteralInComment");
2
        executeTarget("
3
    }
4
    // not used, but public so theoretically must remain for BC?
3
cleanup");
4
    }
5
    public void assertEqualContent(File expect, File result)
5
    public void assertEqualContent(File expect, File result)
6
        throws AssertionFailedError, IOException {
6
        throws AssertionFailedError, IOException {
7
        if (!result.exists()) {
7
        if (!result.exists()) {
8
            fail("Expected file "+result+" doesn\'t exist");
8
            fail("Expected file "+result+" doesn\'t exist");
9
        }
9
        }
10
        InputStream inExpect = null;
10
        InputStream inExpect = null;
11
        InputStream inResult = null;
11
        InputStream inResult = null;
12
        try {
12
        try {
13
            inExpect = new BufferedInputStream(new FileInputStream(expect));
13
            inExpect = new BufferedInputStream(new FileInputStream(expect));
14
            inResult = new BufferedInputStream(new FileInputStream(result));
14
            inResult = new BufferedInputStream(new FileInputStream(result));
15
            int expectedByte = inExpect.read();
15
            int expectedByte = inExpect.read();
16
            while (expectedByte != -1) {
16
            while (expectedByte != -1) {
17
                assertEquals(expectedByte, inResult.read());
17
                assertEquals(expectedByte, inResult.read());
18
                expectedByte = inExpect.read();
18
                expectedByte = inExpect.read();
19
            }
19
            }
20
            assertEquals("End of file", -1, inResult.read());
20
            assertEquals("End of file", -1, inResult.read());
21
        } finally {
21
        } finally {
22
            if (inResult != null) {
22
            if (inResult != null) {
23
                inResult.close();
23
                inResult.close();
24
            }
24
            }
25
            if (inExpect != null) {
25
            if (inExpect != null) {
26
                inExpect.close();
26
                inExpect.close();
27
            }
27
            }
28
        }
28
        }
29
    
29
    
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0