if (toChange == null || toChange.equals("")) { throw new BuildException("P4Reopen: tochange cannot be null or empty"); } this.toChange = toChange;
if (label == null || label.equals("")) { throw new BuildException("P4Sync: Labels cannot be Null or Empty"); } this.label = label;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Reopen.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Sync.java
Method name: void setToChange(String) Method name: void setLabel(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (toChange == null || toChange.equals("")) {
1
if (label == null || label.equals("")) {
2
            throw new BuildException("P4Reopen: tochange cannot be null or empty");
2
            throw new BuildException("P4Sync: Labels cannot be Null or Empty");
3
        }
3
        }
4
        this.toChange = toChange;
4
        this.label = label;
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.2
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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (toChange == null || toChange.equals(""))
    1
    if (toChange == null || toChange.equals(""))
    1
    if (label == null || label.equals(""))
    Differences
    Expression1Expression2Difference
    toChangelabelVARIABLE_NAME_MISMATCH
    toChangelabelVARIABLE_NAME_MISMATCH
    1
    if (label == null || label.equals(""))
    2
    throw new BuildException("P4Reopen: tochange cannot be null or empty");
    2
    throw new BuildException("P4Reopen: tochange cannot be null or empty");
    2
    throw new BuildException("P4Sync: Labels cannot be Null or Empty");
    Differences
    Expression1Expression2Difference
    "P4Reopen: tochange cannot be null or empty""P4Sync: Labels cannot be Null or Empty"LITERAL_VALUE_MISMATCH
    2
    throw new BuildException("P4Sync: Labels cannot be Null or Empty");
    3
    this.toChange = toChange;
    3
    this.toChange = toChange;
    3
    this.label = label;
    Differences
    Expression1Expression2Difference
    toChangelabelVARIABLE_NAME_MISMATCH
    toChangelabelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.toChange is a field being modified, and thus it cannot be parameterized
    Expression this.label is a field being modified, and thus it cannot be parameterized
    3
    this.label = label;
    Precondition Violations (2)
    Row Violation
    1Expression this.toChange is a field being modified, and thus it cannot be parameterized
    2Expression this.label is a field being modified, and thus it cannot be parameterized