String publicid = PublicId.normalize(entry.getEntryArg(0)); String systemid = normalizeURI(entry.getEntryArg(1)); if (resolver == null) { catalogManager.debug .message(1, "Internal Error: null ApacheCatalogResolver"); } else { resolver.addPublicEntry(publicid, systemid, base); }
if (type == URI) { String uri = normalizeURI(entry.getEntryArg(0)); String altURI = normalizeURI(entry.getEntryArg(1)); if (resolver == null) { catalogManager.debug .message(1, "Internal Error: null ApacheCatalogResolver"); } else { resolver.addURIEntry(uri, altURI, base); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resolver/ApacheCatalog.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resolver/ApacheCatalog.java
Method name: void addEntry(CatalogEntry) Method name: void addEntry(CatalogEntry)
Number of AST nodes: 5 Number of AST nodes: 6
1
String publicid = PublicId.
1
if (type == URI) {
2
normalize(entry.getEntryArg(0));
2
            String uri = normalizeURI(entry.getEntryArg(0));
3
            String systemid = normalizeURI(entry.getEntryArg(1));
3
            String altURI = normalizeURI(entry.getEntryArg(1));
4
            if (resolver == null) {
4
            if (resolver == null) {
5
                catalogManager.debug
5
                catalogManager.debug
6
                    .message(1, "Internal Error: null ApacheCatalogResolver");
6
                    .message(1, "Internal Error: null ApacheCatalogResolver");
7
            } else {
7
            } else {
8
                resolver.addPublicEntry(publicid, systemid, base);
8
                resolver.addURIEntry(uri, altURI, base);
9
    
9
            }
10
        }
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 the same method
Number of node comparisons14
  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
    3
    String publicid = PublicId.normalize(entry.getEntryArg(0));
    3
    String publicid = PublicId.normalize(entry.getEntryArg(0));
    9
    String uri = normalizeURI(entry.getEntryArg(0));
    Differences
    Expression1Expression2Difference
    publiciduriVARIABLE_NAME_MISMATCH
    normalizenormalizeURIMETHOD_INVOCATION_NAME_MISMATCH
    PublicIdMISSING_METHOD_INVOCATION_EXPRESSION
    9
    String uri = normalizeURI(entry.getEntryArg(0));
    4
    String systemid = normalizeURI(entry.getEntryArg(1));
    4
    String systemid = normalizeURI(entry.getEntryArg(1));
    10
    String altURI = normalizeURI(entry.getEntryArg(1));
    Differences
    Expression1Expression2Difference
    systemidaltURIVARIABLE_NAME_MISMATCH
    10
    String altURI = normalizeURI(entry.getEntryArg(1));
    5
    if (resolver == null)
    11
    if (resolver == null)
    6
    catalogManager.debug.message(1, "Internal Error: null ApacheCatalogResolver");
    12
    catalogManager.debug.message(1, "Internal Error: null ApacheCatalogResolver");
    else
    else
    7
    resolver.addPublicEntry(publicid, systemid, base);
    7
    resolver.addPublicEntry(publicid, systemid, base);
    13
    resolver.addURIEntry(uri, altURI, base);
    Differences
    Expression1Expression2Difference
    addPublicEntryaddURIEntryMETHOD_INVOCATION_NAME_MISMATCH
    publiciduriVARIABLE_NAME_MISMATCH
    systemidaltURIVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression resolver.addPublicEntry(publicid,systemid,base) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression resolver.addURIEntry(uri,altURI,base) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression resolver.addPublicEntry(publicid,systemid,base) is a void method call, and thus it cannot be parameterized
    Expression resolver.addURIEntry(uri,altURI,base) is a void method call, and thus it cannot be parameterized
    13
    resolver.addURIEntry(uri, altURI, base);
    Precondition Violations (4)
    Row Violation
    1Expression resolver.addPublicEntry(publicid,systemid,base) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression resolver.addURIEntry(uri,altURI,base) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression resolver.addPublicEntry(publicid,systemid,base) is a void method call, and thus it cannot be parameterized
    4Expression resolver.addURIEntry(uri,altURI,base) is a void method call, and thus it cannot be parameterized