BufferedInputStream bis = new BufferedInputStream(new FileInputStream(findTestFile(name))); ByteArrayOutputStream baos = new ByteArrayOutputStream(1000); int len = 0; byte[] data = new byte[512]; while ((len = bis.read(data)) >= 0) { baos.write(data, 0, len); } bis.close(); return baos;
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(findTestFile(name))); ByteArrayOutputStream baos = new ByteArrayOutputStream(1000); int len = 0; byte[] data = new byte[512]; while ((len = bis.read(data)) >= 0) { baos.write(data, 0, len); } bis.close(); return baos;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java
Method name: ByteArrayOutputStream readBA(String) Method name: ByteArrayOutputStream readBA(String)
Number of AST nodes: 8 Number of AST nodes: 8
1
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(findTestFile(name)));
1
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(findTestFile(name)));
2
		ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
2
		ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
3
		int len = 0;
3
		int len = 0;
4
		byte[] data = new byte[512];
4
		byte[] data = new byte[512];
5
		while ((len = bis.read(data)) >= 0) {
5
		while ((len = bis.read(data)) >= 0) {
6
			baos.write(data, 0, len);
6
			baos.write(data, 0, len);
7
		}
7
		}
8
		bis.close();
8
		bis.close();
9
		return baos;
9
		return baos;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons20
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    BufferedInputStream bis = new BufferedInputStream(new FileInputStream(findTestFile(name)));
    1
    BufferedInputStream bis = new BufferedInputStream(new FileInputStream(findTestFile(name)));
    2
    ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
    2
    ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
    3
    int len = 0;
    3
    int len = 0;
    4
    byte[] data = new byte[512];
    4
    byte[] data = new byte[512];
    5
    while ((len = bis.read(data)) >= 0)
    5
    while ((len = bis.read(data)) >= 0)
    6
    baos.write(data, 0, len);
    6
    baos.write(data, 0, len);
    7
    bis.close();
    7
    bis.close();
    8
    return baos;
    8
    return baos;
    Precondition Violations (0)
    Row Violation