if ((tmpprop = getProject().getProperty("p4.port")) != null) { setPort(tmpprop); } if ((tmpprop = getProject().getProperty("p4.client")) != null) { setClient(tmpprop); }
if ((tmpprop = getProject().getProperty("p4.client")) != null) { setClient(tmpprop); } if ((tmpprop = getProject().getProperty("p4.user")) != null) { setUser(tmpprop); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java
Method name: void init() Method name: void init()
Number of AST nodes: 4 Number of AST nodes: 4
1
if ((tmpprop = getProject().getProperty("p4.port")) != null) {
1
if ((tmpprop = getProject().getProperty("p4.client")) != null) {
2
            setPort(tmpprop);
2
            setClient(tmpprop);
3
        }
3
        }
4
        if ((tmpprop = getProject().getProperty("p4.client")) != null) {
4
        if ((tmpprop = getProject().getProperty("p4.user")) != null) {
5
            setClient(tmpprop);
5
            setUser(tmpprop);
6
        }
6
        }
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 the same method
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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
    3
    if ((tmpprop = getProject().getProperty("p4.port")) != null)
    3
    if ((tmpprop = getProject().getProperty("p4.port")) != null)
    5
    if ((tmpprop = getProject().getProperty("p4.client")) != null)
    Differences
    Expression1Expression2Difference
    "p4.port""p4.client"LITERAL_VALUE_MISMATCH
    5
    if ((tmpprop = getProject().getProperty("p4.client")) != null)
    4
    setPort(tmpprop);
    4
    setPort(tmpprop);
    6
    setClient(tmpprop);
    Differences
    Expression1Expression2Difference
    setPortsetClientMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression setPort(tmpprop) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setClient(tmpprop) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setPort(tmpprop) is a void method call, and thus it cannot be parameterized
    Expression setClient(tmpprop) is a void method call, and thus it cannot be parameterized
    6
    setClient(tmpprop);
    5
    if ((tmpprop = getProject().getProperty("p4.client")) != null)
    5
    if ((tmpprop = getProject().getProperty("p4.client")) != null)
    7
    if ((tmpprop = getProject().getProperty("p4.user")) != null)
    Differences
    Expression1Expression2Difference
    "p4.client""p4.user"LITERAL_VALUE_MISMATCH
    7
    if ((tmpprop = getProject().getProperty("p4.user")) != null)
    6
    setClient(tmpprop);
    6
    setClient(tmpprop);
    8
    setUser(tmpprop);
    Differences
    Expression1Expression2Difference
    setClientsetUserMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression setClient(tmpprop) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setUser(tmpprop) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setClient(tmpprop) is a void method call, and thus it cannot be parameterized
    Expression setUser(tmpprop) is a void method call, and thus it cannot be parameterized
    8
    setUser(tmpprop);
    Precondition Violations (8)
    Row Violation
    1Expression setPort(tmpprop) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression setClient(tmpprop) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression setPort(tmpprop) is a void method call, and thus it cannot be parameterized
    4Expression setClient(tmpprop) is a void method call, and thus it cannot be parameterized
    5Expression setClient(tmpprop) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression setUser(tmpprop) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression setClient(tmpprop) is a void method call, and thus it cannot be parameterized
    8Expression setUser(tmpprop) is a void method call, and thus it cannot be parameterized