int pfx = len - in.length(); if (pfx <= 0) { return in; } if (pfx > SPACES_LEN) { pfx = SPACES_LEN; } in.insert(0, SPACES.substring(0, pfx)); return in;
int sfx = len - in.length(); if (sfx <= 0) { return in; } if (sfx > SPACES_LEN) { sfx = SPACES_LEN; } in.append(SPACES.substring(0, sfx)); return in;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/JOrphanUtils.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/JOrphanUtils.java
Method name: StringBuffer rightAlign(StringBuffer, int) Method name: StringBuffer leftAlign(StringBuffer, int)
Number of AST nodes: 7 Number of AST nodes: 7
1
int pfx = len - in.length();
1
int sfx = len - in.length();
2
		if (pfx <= 0) {
2
		if (sfx <= 0) {
3
			return in;
3
			return in;
4
		}
4
		}
5
		if (pfx > SPACES_LEN) {
5
		if (sfx > SPACES_LEN) {
6
			pfx = SPACES_LEN;
6
			sfx = SPACES_LEN;
7
		}
7
		}
8
		in.insert(0, SPACES.substring(0, pfx));
8
		in.append(SPACES.substring(0, sfx));
9
		return in;
9
		return in;
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.3
Clones locationClones are declared in the same class
Number of node comparisons19
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    int pfx = len - in.length();
    1
    int pfx = len - in.length();
    1
    int sfx = len - in.length();
    Differences
    Expression1Expression2Difference
    pfxsfxVARIABLE_NAME_MISMATCH
    1
    int sfx = len - in.length();
    2
    if (pfx <= 0)
    2
    if (pfx <= 0)
    2
    if (sfx <= 0)
    Differences
    Expression1Expression2Difference
    pfxsfxVARIABLE_NAME_MISMATCH
    2
    if (sfx <= 0)
    3
    return in;
    3
    return in;
    4
    if (pfx > SPACES_LEN)
    4
    if (pfx > SPACES_LEN)
    4
    if (sfx > SPACES_LEN)
    Differences
    Expression1Expression2Difference
    pfxsfxVARIABLE_NAME_MISMATCH
    4
    if (sfx > SPACES_LEN)
    5
    pfx = SPACES_LEN;
    5
    pfx = SPACES_LEN;
    5
    sfx = SPACES_LEN;
    Differences
    Expression1Expression2Difference
    pfxsfxVARIABLE_NAME_MISMATCH
    5
    sfx = SPACES_LEN;
    6
    in.insert(0, SPACES.substring(0, pfx));
    6
    in.insert(0, SPACES.substring(0, pfx));
    6
    in.append(SPACES.substring(0, sfx));
    Differences
    Expression1Expression2Difference
    insertappendMETHOD_INVOCATION_NAME_MISMATCH
    in.insert(0,SPACES.substring(0,pfx))in.append(SPACES.substring(0,sfx))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression in.insert(0,SPACES.substring(0,pfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression in.append(SPACES.substring(0,sfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression in.insert(0,SPACES.substring(0,pfx)) is a void method call, and thus it cannot be parameterized
    Expression in.append(SPACES.substring(0,sfx)) is a void method call, and thus it cannot be parameterized
    Expression in.insert(0,SPACES.substring(0,pfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression in.append(SPACES.substring(0,sfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression in.insert(0,SPACES.substring(0,pfx)) is a void method call, and thus it cannot be parameterized
    Expression in.append(SPACES.substring(0,sfx)) is a void method call, and thus it cannot be parameterized
    6
    in.append(SPACES.substring(0, sfx));
    7
    return in;
    7
    return in;
    Precondition Violations (8)
    Row Violation
    1Expression in.insert(0,SPACES.substring(0,pfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression in.append(SPACES.substring(0,sfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression in.insert(0,SPACES.substring(0,pfx)) is a void method call, and thus it cannot be parameterized
    4Expression in.append(SPACES.substring(0,sfx)) is a void method call, and thus it cannot be parameterized
    5Expression in.insert(0,SPACES.substring(0,pfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression in.append(SPACES.substring(0,sfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression in.insert(0,SPACES.substring(0,pfx)) is a void method call, and thus it cannot be parameterized
    8Expression in.append(SPACES.substring(0,sfx)) is a void method call, and thus it cannot be parameterized