try { return new URL(u); } catch (MalformedURLException e) { throw new BuildException(e); }
File pathComponent = project != null ? project.resolveFile(pathElement) : new File(pathElement); try { addPathFile(pathComponent); } catch (IOException e) { throw new BuildException(e); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/URLResource.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/AntClassLoader.java
Method name: URL newURL(String) Method name: void addPathElement(String)
Number of AST nodes: 2 Number of AST nodes: 3
1
try {
2
            return new URL(u);
3
        } catch (MalformedURL
1
File pathComponent
2
            = project != null ? project.resolveFile(pathElement)
3
            : new File(pathElement);
4
        try {
5
            addPathFile(pathComponent);
4
Exception e) {
6
        } catch (IOException e) {
5
            throw new BuildException(e);
7
            throw new BuildException(e);
6
        }
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.2
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                      
    1
    File pathComponent = project != null ? project.resolveFile(pathElement) : new File(pathElement);
    1
    try
    1
    try
    2
    try
    Differences
    Expression1Expression2Difference
    java.net.MalformedURLExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    java.net.MalformedURLExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    java.net.MalformedURLExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    2
    try
    2
    return new URL(u);
    2
    return new URL(u);
    Preondition Violations
    Unmatched return new URL(u);
                                              
                                                                
    3
    addPathFile(pathComponent);
    Preondition Violations
    Unmatched statement addPathFile(pathComponent); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3
    addPathFile(pathComponent);
    Precondition Violations (2)
    Row Violation
    1Unmatched return new URL(u);
    2Unmatched statement addPathFile(pathComponent); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted