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