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"); } } InputSource source = null; URL url = null;
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"); } } InputSource source = null; URL url = null;
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: 6 Number of AST nodes: 6
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
        }
10
        InputSource source = null;
10
        InputSource source = null;
11
        URL url = null;
11
        URL url = null;
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.3
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.8
    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());
    8
    InputSource source = null;
    7
    InputSource source = null;
    9
    URL url = null;
    8
    URL url = null;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables baseURL, url, source , while Clone fragment #2 returns variables baseURL, url, source