if (getSosServerPath() == null) { throw new BuildException("sosserverpath attribute must be set!", getLocation()); } commandLine.createArgument().setValue(FLAG_SOS_SERVER); commandLine.createArgument().setValue(getSosServerPath()); // Login info is required if (getUsername() == null) { throw new BuildException("username attribute must be set!", getLocation()); } commandLine.createArgument().setValue(FLAG_USERNAME); commandLine.createArgument().setValue(getUsername());
if (getVssServerPath() == null) { throw new BuildException("vssserverpath attribute must be set!", getLocation()); } commandLine.createArgument().setValue(FLAG_VSS_SERVER); commandLine.createArgument().setValue(getVssServerPath()); // VSS project is required if (getProjectPath() == null) { throw new BuildException("projectpath attribute must be set!", getLocation()); } commandLine.createArgument().setValue(FLAG_PROJECT); commandLine.createArgument().setValue(getProjectPath());
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: 8 Number of AST nodes: 8
1
if (getSosServerPath() == null) {
1
if (getVssServerPath() == null) {
2
            throw new BuildException("sosserverpath attribute must be set!", getLocation());
2
            throw new BuildException("vssserverpath attribute must be set!", getLocation());
3
        }
3
        }
4
        commandLine.createArgument().setValue(FLAG_SOS_SERVER);
4
        commandLine.createArgument().setValue(FLAG_VSS_SERVER);
5
        commandLine.createArgument().setValue(getSosServerPath());
5
        commandLine.createArgument().setValue(getVssServerPath());
6
        // Login info is required
6
        // VSS project is required
7
        if (getUsername() == null) {
7
        if (getProjectPath() == null) {
8
            throw new BuildException("username attribute must be set!", getLocation());
8
            throw new BuildException("projectpath attribute must be set!", getLocation());
9
        }
9
        }
10
        commandLine.createArgument().setValue(FLAG_USERNAME);
10
        commandLine.createArgument().setValue(FLAG_PROJECT);
11
        commandLine.createArgument().setValue(getUsername());
11
        commandLine.createArgument().setValue(getProjectPath());
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.4
Clones locationClones are in the same method
Number of node comparisons29
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)9.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (getSosServerPath() == null)
    2
    if (getSosServerPath() == null)
    12
    if (getVssServerPath() == null)
    Differences
    Expression1Expression2Difference
    getSosServerPathgetVssServerPathMETHOD_INVOCATION_NAME_MISMATCH
    12
    if (getVssServerPath() == null)
    3
    throw new BuildException("sosserverpath attribute must be set!", getLocation());
    3
    throw new BuildException("sosserverpath attribute must be set!", getLocation());
    13
    throw new BuildException("vssserverpath attribute must be set!", getLocation());
    Differences
    Expression1Expression2Difference
    "sosserverpath attribute must be set!""vssserverpath attribute must be set!"LITERAL_VALUE_MISMATCH
    13
    throw new BuildException("vssserverpath attribute must be set!", getLocation());
    4
    commandLine.createArgument().setValue(FLAG_SOS_SERVER);
    4
    commandLine.createArgument().setValue(FLAG_SOS_SERVER);
    14
    commandLine.createArgument().setValue(FLAG_VSS_SERVER);
    Differences
    Expression1Expression2Difference
    FLAG_SOS_SERVERFLAG_VSS_SERVERVARIABLE_NAME_MISMATCH
    14
    commandLine.createArgument().setValue(FLAG_VSS_SERVER);
    5
    commandLine.createArgument().setValue(getSosServerPath());
    5
    commandLine.createArgument().setValue(getSosServerPath());
    15
    commandLine.createArgument().setValue(getVssServerPath());
    Differences
    Expression1Expression2Difference
    getSosServerPathgetVssServerPathMETHOD_INVOCATION_NAME_MISMATCH
    15
    commandLine.createArgument().setValue(getVssServerPath());
    6
    if (getUsername() == null)
    6
    if (getUsername() == null)
    16
    if (getProjectPath() == null)
    Differences
    Expression1Expression2Difference
    getUsernamegetProjectPathMETHOD_INVOCATION_NAME_MISMATCH
    16
    if (getProjectPath() == null)
    7
    throw new BuildException("username attribute must be set!", getLocation());
    7
    throw new BuildException("username attribute must be set!", getLocation());
    17
    throw new BuildException("projectpath attribute must be set!", getLocation());
    Differences
    Expression1Expression2Difference
    "username attribute must be set!""projectpath attribute must be set!"LITERAL_VALUE_MISMATCH
    17
    throw new BuildException("projectpath attribute must be set!", getLocation());
    8
    commandLine.createArgument().setValue(FLAG_USERNAME);
    8
    commandLine.createArgument().setValue(FLAG_USERNAME);
    18
    commandLine.createArgument().setValue(FLAG_PROJECT);
    Differences
    Expression1Expression2Difference
    FLAG_USERNAMEFLAG_PROJECTVARIABLE_NAME_MISMATCH
    18
    commandLine.createArgument().setValue(FLAG_PROJECT);
    9
    commandLine.createArgument().setValue(getUsername());
    9
    commandLine.createArgument().setValue(getUsername());
    19
    commandLine.createArgument().setValue(getProjectPath());
    Differences
    Expression1Expression2Difference
    getUsernamegetProjectPathMETHOD_INVOCATION_NAME_MISMATCH
    19
    commandLine.createArgument().setValue(getProjectPath());
    Precondition Violations (0)
    Row Violation