if (isAlwaysEncoded()) { return cache.getEncoded(getValue(), contentEncoding); } else { return getValue(); }
if (isAlwaysEncoded()) { return cache.getEncoded(getName()); } else { return getName(); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/HTTPArgument.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/HTTPArgument.java
Method name: String getEncodedValue(String) Method name: String getEncodedName()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (isAlwaysEncoded()) {
1
if (isAlwaysEncoded()) {
2
            return cache.getEncoded(getValue(), contentEncoding);
2
			return cache.getEncoded(get
3
        } else {
4
            
3
Name());
4
		} else {
5
return getValue();
5
			return getName();
6
        }
6
		}
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.1
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {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)6.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isAlwaysEncoded())
    1
    if (isAlwaysEncoded())
    2
    return cache.getEncoded(getValue(), contentEncoding);
    2
    return cache.getEncoded(getValue(), contentEncoding);
    2
    return cache.getEncoded(getName());
    Differences
    Expression1Expression2Difference
    cache.getEncoded(getValue(),contentEncoding)cache.getEncoded(getName())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression cache.getEncoded(getValue(),contentEncoding) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cache.getEncoded(getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    return cache.getEncoded(getName());
    else
    else
    3
    return getValue();
    3
    return getValue();
    3
    return getName();
    Differences
    Expression1Expression2Difference
    getValuegetNameMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getValue() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression getName() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3
    return getName();
    Precondition Violations (4)
    Row Violation
    1Expression cache.getEncoded(getValue(),contentEncoding) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression cache.getEncoded(getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression getValue() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    4Expression getName() is a method call throwing exception(s) that should be caught by a try block that will be extracted