if (matchingEntry.getBase() != null) { baseURL = matchingEntry.getBase(); } else { try { baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir()); } catch (MalformedURLException ex) { throw new BuildException("Project basedir cannot be converted to a URL"); } }
if (matchingEntry.getBase() != null) { baseURL = matchingEntry.getBase(); } else { try { baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir()); } catch (MalformedURLException ex) { throw new BuildException("Project basedir cannot be converted to a URL"); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/XMLCatalog.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/XMLCatalog.java
Method name: InputSource filesystemLookup(ResourceLocation) Method name: InputSource urlLookup(ResourceLocation)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (matchingEntry.getBase() != null) {
1
if (matchingEntry.getBase() != null) {
2
            baseURL = matchingEntry.getBase();
2
            baseURL = matchingEntry.getBase();
3
        } else {
3
        } else {
4
            try {
4
            try {
5
                baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());
5
                baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());
6
            } catch (MalformedURLException ex) {
6
            } catch (MalformedURLException ex) {
7
                throw new BuildException("Project basedir cannot be converted to a URL");
7
                throw new BuildException("Project basedir cannot be converted to a URL");
8
            }
8
            }
9
        }
9
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {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 1
    Mapped Statements
    ID Statement ID Statement
    4
    if (matchingEntry.getBase() != null)
    3
    if (matchingEntry.getBase() != null)
    5
    baseURL = matchingEntry.getBase();
    4
    baseURL = matchingEntry.getBase();
    else
    else
    6
    try
    5
    try
    7
    baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());
    6
    baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());
    Precondition Violations (0)
    Row Violation