if (namespace != null ? !namespace.equals(schemaLocation.namespace) : schemaLocation.namespace != null) { return false; } if (url != null ? !url.equals(schemaLocation.url) : schemaLocation.url != null) { return false; }
if (file != null ? !file.equals(schemaLocation.file) : schemaLocation.file != null) { return false; } if (namespace != null ? !namespace.equals(schemaLocation.namespace) : schemaLocation.namespace != null) { return false; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/SchemaValidate.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/SchemaValidate.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (namespace != null ? !namespace.equals(schemaLocation.namespace)
1
if (file != null ? !file.equals(schemaLocation.
2
                    : schemaLocation.namespace != null) {
2
file) : schemaLocation.file != null) {
3
                return false;
3
                return false;
4
            }
4
            }
5
            if (url != null ? !url.equals(schemaLocation.url)
5
            if (namespace != null ? !namespace.equals(schemaLocation.namespace)
6
 : schemaLocation.url != null) {
6
                    : schemaLocation.namespace != null) {
7
                return false;
7
                return false;
8
            }
8
            }
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.8
Clones locationClones are in the same method
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    if (namespace != null ? !namespace.equals(schemaLocation.namespace) : schemaLocation.namespace != null)
    8
    if (namespace != null ? !namespace.equals(schemaLocation.namespace) : schemaLocation.namespace != null)
    9
    return false;
    9
    return false;
    9
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    9
    return false;
    10
    if (url != null ? !url.equals(schemaLocation.url) : schemaLocation.url != null)
    10
    if (url != null ? !url.equals(schemaLocation.url) : schemaLocation.url != null)
    6
    if (file != null ? !file.equals(schemaLocation.file) : schemaLocation.file != null)
    Differences
    Expression1Expression2Difference
    urlfileVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    urlfileVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    urlfileVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    urlfileVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable url does not match with type java.io.File of variable file
    • Make classes java.lang.String and java.io.File extend a common superclass
    Type java.lang.String of variable schemaLocation.url does not match with type java.io.File of variable schemaLocation.file
    • Make classes java.lang.String and java.io.File extend a common superclass
    Type java.lang.String of variable url does not match with type java.io.File of variable file
    • Make classes java.lang.String and java.io.File extend a common superclass
    Type java.lang.String of variable schemaLocation.url does not match with type java.io.File of variable schemaLocation.file
    • Make classes java.lang.String and java.io.File extend a common superclass
    6
    if (file != null ? !file.equals(schemaLocation.file) : schemaLocation.file != null)
    11
    return false;
    11
    return false;
    7
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    7
    return false;
    Precondition Violations (8)
    Row Violation
    1Type java.lang.String of variable url does not match with type java.io.File of variable file
    2Type java.lang.String of variable schemaLocation.url does not match with type java.io.File of variable schemaLocation.file
    3Type java.lang.String of variable url does not match with type java.io.File of variable file
    4Type java.lang.String of variable schemaLocation.url does not match with type java.io.File of variable schemaLocation.file
    5Conditional return false;
    6Conditional return false;
    7Conditional return false;
    8Conditional return false;