boolean checkin = true; int fileStatus = (eachFile.getStatus()); // We try to update the status once to give StarTeam // another chance. if (fileStatus == Status.MERGE || fileStatus == Status.UNKNOWN) { eachFile.updateStatus(true, true); fileStatus = (eachFile.getStatus()); }
boolean checkout = true; // Just a note: StarTeam has a status for NEW which implies // that there is an item on your local machine that is not // in the repository. These are the items that show up as // NOT IN VIEW in the Starteam GUI. // One would think that we would want to perhaps checkin the // NEW items (not in all cases! - Steve Cohen 15 Dec 2001) // Unfortunately, the sdk doesn't really work, and we can't // actually see anything with a status of NEW. That is why // we can just check out everything here without worrying // about losing anything. int fileStatus = (eachFile.getStatus()); // We try to update the status once to give StarTeam // another chance. if (fileStatus == Status.MERGE || fileStatus == Status.UNKNOWN) { eachFile.updateStatus(true, true); fileStatus = (eachFile.getStatus()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckin.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java
Method name: void processFile(com.starbase.starteam.File) Method name: void processFile(com.starbase.starteam.File, File)
Number of AST nodes: 5 Number of AST nodes: 5
1
boolean checkin = true;
1
boolean check
2
out = true;
3
            // Just a note: StarTeam has a status for NEW which implies
4
            // that there is an item  on your local machine that is not
5
            // in the repository.  These are the items that show up as
6
            // NOT IN VIEW in the Starteam GUI.
7
            // One would think that we would want to perhaps checkin the
8
            // NEW items (not in all cases! - Steve Cohen 15 Dec 2001)
9
            // Unfortunately, the sdk doesn't really work, and we can't
10
            // actually see  anything with a status of NEW. That is why
11
            // we can just check out  everything here without worrying
12
            // about losing anything.
2
        int fileStatus = (eachFile.getStatus());
13
            int fileStatus = (eachFile.getStatus());
3
        // We try to update the status once to give StarTeam
14
            // We try to update the status once to give StarTeam
4
        // another chance.
15
            // another chance.
5
        if (fileStatus == Status.MERGE
16
            if (fileStatus == Status.MERGE
6
 || fileStatus == Status.UNKNOWN) {
17
                || fileStatus == Status.UNKNOWN) {
7
            eachFile.updateStatus(true, true);
18
                eachFile.updateStatus(true, true);
8
            fileStatus = (eachFile.getStatus());
19
                fileStatus = (eachFile.getStatus());
9
        }
20
            }
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    boolean checkin = true;
    5
    boolean checkin = true;
    14
    boolean checkout = true;
    Differences
    Expression1Expression2Difference
    checkincheckoutVARIABLE_NAME_MISMATCH
    14
    boolean checkout = true;
    6
    int fileStatus = (eachFile.getStatus());
    15
    int fileStatus = (eachFile.getStatus());
    7
    if (fileStatus == Status.MERGE || fileStatus == Status.UNKNOWN)
    16
    if (fileStatus == Status.MERGE || fileStatus == Status.UNKNOWN)
    8
    eachFile.updateStatus(true, true);
    17
    eachFile.updateStatus(true, true);
    9
    fileStatus = (eachFile.getStatus());
    18
    fileStatus = (eachFile.getStatus());
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables fileStatus, checkin , while Clone fragment #2 returns variables fileStatus, checkout