if (f.isDirectory()) { return true; } return false;
if(name.startsWith(urlPrefix)) { return true; } return false;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/configuration/FactoryProviderController.java File path: /sql12/plugins/graph/src/net/sourceforge/squirrel_sql/plugins/graph/xmlbeans/GraphXmlSerializer.java
Method name: boolean accept(File) Method name: boolean accept(File, String)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (f.isDirectory())
1
if
2
            {
2
(name.startsWith(urlPrefix))
3
                        {
3
               return true;
4
                           return true;
4
            }
5
                 
6
       }
5
            return false;
7
                        return false;
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
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (f.isDirectory())
    1
    if (f.isDirectory())
    1
    if (name.startsWith(urlPrefix))
    Differences
    Expression1Expression2Difference
    isDirectorystartsWithMETHOD_INVOCATION_NAME_MISMATCH
    fnameVARIABLE_NAME_MISMATCH
    java.io.Filejava.lang.StringVARIABLE_TYPE_MISMATCH
    f.isDirectory()name.startsWith(urlPrefix)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Type java.io.File of variable f does not match with type java.lang.String of variable name
    • Make classes java.io.File and java.lang.String extend a common superclass
    1
    if (name.startsWith(urlPrefix))
    2
    return true;
    2
    return true;
    3
    return false;
    3
    return false;
    Precondition Violations (2)
    Row Violation
    1Type java.io.File of variable f does not match with type java.lang.String of variable name
    2The refactoring of the clones is infeasible, because classes and do not have a common superclass