for (int i = 0; i < (resultData.length - 1); i++) { if (resultData[i] == NEW_LINE && resultData[i + 1] == NEW_LINE) { return getByteArraySlice(resultData, (i + 2), resultData.length - 1); } }
for (int i = 0; i < (resultData.length - 1); i++) { if (resultData[i] == '\n' && resultData[i + 1] == '\n') { return JOrphanUtils.getByteArraySlice(resultData, (i + 2), resultData.length - 1); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/XMLAssertion.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/XMLSchemaAssertion.java
Method name: byte[] getResultBody(byte[]) Method name: byte[] getResultBody(byte[])
Number of AST nodes: 3 Number of AST nodes: 3
1
for (int i = 0; i < (resultData.length - 1); i++) {
1
for (int i = 0; i < (resultData.length - 1); i++) {
2
			if (resultData[i] == NEW_LINE && resultData[i + 1] == NEW_LINE) {
2
			if (resultData[i] == '\n' && resultData[i + 1] == '\n') {
3
				return getByteArraySlice(resultData, (i + 2), resultData.length - 1);
3
				return JOrphanUtils.getByteArraySlice(resultData, (i + 2), resultData.length - 1);
4
			}
4
			}
5
		}
5
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < (resultData.length - 1); i++)
    1
    for (int i = 0; i < (resultData.length - 1); i++)
    2
    if (resultData[i] == NEW_LINE && resultData[i + 1] == NEW_LINE)
    2
    if (resultData[i] == NEW_LINE && resultData[i + 1] == NEW_LINE)
    2
    if (resultData[i] == '\n' && resultData[i + 1] == '\n')
    Differences
    Expression1Expression2Difference
    NEW_LINE'\n'TYPE_COMPATIBLE_REPLACEMENT
    NEW_LINE'\n'TYPE_COMPATIBLE_REPLACEMENT
    2
    if (resultData[i] == '\n' && resultData[i + 1] == '\n')
    3
    return getByteArraySlice(resultData, (i + 2), resultData.length - 1);
    3
    return getByteArraySlice(resultData, (i + 2), resultData.length - 1);
    3
    return JOrphanUtils.getByteArraySlice(resultData, (i + 2), resultData.length - 1);
    Differences
    Expression1Expression2Difference
    JOrphanUtilsMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression getByteArraySlice(resultData,(i + 2),resultData.length - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method getByteArraySlice
    Expression JOrphanUtils.getByteArraySlice(resultData,(i + 2),resultData.length - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    return JOrphanUtils.getByteArraySlice(resultData, (i + 2), resultData.length - 1);
    Precondition Violations (2)
    Row Violation
    1Expression getByteArraySlice(resultData,(i + 2),resultData.length - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression JOrphanUtils.getByteArraySlice(resultData,(i + 2),resultData.length - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted