if (passFile == null) { File defaultPassFile = new File( System.getProperty("cygwin.user.home", System.getProperty("user.home")) + File.separatorChar + ".cvspass"); if (defaultPassFile.exists()) { this.setPassfile(defaultPassFile); } }
for (int i = 0; i < ARCHIVE_LOCATIONS.length; i++) { File f = new File(home, ARCHIVE_LOCATIONS[i]); if (f.exists()) { return i; } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/AbstractCvsTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
Method name: void runCommand(Commandline) Method name: int getArchiveLocationIndex(File)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (passFile == null) {
1
for (int i = 0; i < ARCHIVE_LOCATIONS.length; i++) {
2
            File defaultPassFile = new File(
2
            File 
3
                System.getProperty("cygwin.user.home",
4
                    System.getProperty("user.home"))
5
                + File.separatorChar + ".cvspass");
3
f = new File(home, ARCHIVE_LOCATIONS[i]);
6
            if (defaultPassFile.exists()) {
4
            if (f.exists()) {
7
                this.setPassfile(defaultPassFile);
5
                return i;
8
            }
6
            }
9
        }
7
        }
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    File defaultPassFile = new File(System.getProperty("cygwin.user.home", System.getProperty("user.home")) + File.separatorChar + ".cvspass");
    8
    File defaultPassFile = new File(System.getProperty("cygwin.user.home", System.getProperty("user.home")) + File.separatorChar + ".cvspass");
    4
    File f = new File(home, ARCHIVE_LOCATIONS[i]);
    Differences
    Expression1Expression2Difference
    defaultPassFilefVARIABLE_NAME_MISMATCH
    new File(System.getProperty("cygwin.user.home",System.getProperty("user.home")) + File.separatorChar + ".cvspass")new File(home,ARCHIVE_LOCATIONS[i])ARGUMENT_NUMBER_MISMATCH
    4
    File f = new File(home, ARCHIVE_LOCATIONS[i]);
    9
    if (defaultPassFile.exists())
    9
    if (defaultPassFile.exists())
    5
    if (f.exists())
    Differences
    Expression1Expression2Difference
    defaultPassFilefVARIABLE_NAME_MISMATCH
    5
    if (f.exists())
                            
    6
    return i;
    Preondition Violations
    Unmatched return i;
    6
    return i;
    10
    this.setPassfile(defaultPassFile);
                                                                                
    Precondition Violations (2)
    Row Violation
    1Unmatched return i;
    2Clone fragment #1 returns variables defaultPassFile , while Clone fragment #2 returns variables