if (getProjectPath() == null) { throw new BuildException("projectpath attribute must be set!", getLocation()); } commandLine.createArgument().setValue(FLAG_PROJECT); commandLine.createArgument().setValue(getProjectPath());
if (getUsername() == null) { throw new BuildException("username attribute must be set!", getLocation()); } commandLine.createArgument().setValue(FLAG_USERNAME); commandLine.createArgument().setValue(getUsername());
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOS.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOS.java
Method name: void getRequiredAttributes() Method name: void getRequiredAttributes()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (getProjectPath() == null) {
1
if (getUsername() == null) {
2
            throw new BuildException("projectpath attribute must be set!", getLocation());
2
            throw new BuildException("username attribute must be set!", getLocation());
3
        }
3
        }
4
        commandLine.createArgument().setValue(FLAG_PROJECT);
4
        commandLine.createArgument().setValue(FLAG_USERNAME);
5
        commandLine.createArgument().setValue(getProjectPath());
5
        commandLine.createArgument().setValue(getUsername());
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.2
Clones locationClones are in the same method
Number of node comparisons8
  1. {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)3.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    16
    if (getProjectPath() == null)
    16
    if (getProjectPath() == null)
    6
    if (getUsername() == null)
    Differences
    Expression1Expression2Difference
    getProjectPathgetUsernameMETHOD_INVOCATION_NAME_MISMATCH
    6
    if (getUsername() == null)
    17
    throw new BuildException("projectpath attribute must be set!", getLocation());
    17
    throw new BuildException("projectpath attribute must be set!", getLocation());
    7
    throw new BuildException("username attribute must be set!", getLocation());
    Differences
    Expression1Expression2Difference
    "projectpath attribute must be set!""username attribute must be set!"LITERAL_VALUE_MISMATCH
    7
    throw new BuildException("username attribute must be set!", getLocation());
    18
    commandLine.createArgument().setValue(FLAG_PROJECT);
    18
    commandLine.createArgument().setValue(FLAG_PROJECT);
    8
    commandLine.createArgument().setValue(FLAG_USERNAME);
    Differences
    Expression1Expression2Difference
    FLAG_PROJECTFLAG_USERNAMEVARIABLE_NAME_MISMATCH
    8
    commandLine.createArgument().setValue(FLAG_USERNAME);
    19
    commandLine.createArgument().setValue(getProjectPath());
    19
    commandLine.createArgument().setValue(getProjectPath());
    9
    commandLine.createArgument().setValue(getUsername());
    Differences
    Expression1Expression2Difference
    getProjectPathgetUsernameMETHOD_INVOCATION_NAME_MISMATCH
    9
    commandLine.createArgument().setValue(getUsername());
    Precondition Violations (0)
    Row Violation