if (!remoteSensitivityChecked) { try { checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory()); } catch (IOException ioe) { throw new BuildException(ioe, getLocation()); } }
try { setURL(FILE_UTILS.getFileURL(f)); } catch (MalformedURLException e) { throw new BuildException(e); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/FTP.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/URLResource.java
Method name: void forceRemoteSensitivityCheck() Method name: void setFile(File)
Number of AST nodes: 3 Number of AST nodes: 2
1
if (!remoteSensitivityChecked) {
2
                try {
3
                    checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory());
4
        
1
try {
2
            setURL(FILE_UTILS.getFileURL(f));
5
        } catch (IOException ioe) {
3
        } catch (MalformedURLException e) {
6
                    throw new BuildException(ioe, getLocation());
4
            throw new BuildException(
7
                }
8
    
5
e);
9
        }
6
        }
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 statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)16.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    1
    try
    Differences
    Expression1Expression2Difference
    java.io.IOExceptionjava.net.MalformedURLExceptionSUBCLASS_TYPE_MISMATCH
    ioeeVARIABLE_NAME_MISMATCH
    java.io.IOExceptionjava.net.MalformedURLExceptionSUBCLASS_TYPE_MISMATCH
    new BuildException(ioe,getLocation())new BuildException(e)ARGUMENT_NUMBER_MISMATCH
    1
    try
    3
    checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory());
    3
    checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory());
    2
    setURL(FILE_UTILS.getFileURL(f));
    Differences
    Expression1Expression2Difference
    checkRemoteSensitivitysetURLMETHOD_INVOCATION_NAME_MISMATCH
    checkRemoteSensitivity(ftp.listFiles(),ftp.printWorkingDirectory())setURL(FILE_UTILS.getFileURL(f))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression checkRemoteSensitivity(ftp.listFiles(),ftp.printWorkingDirectory()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    • Inline private method checkRemoteSensitivity
    Expression setURL(FILE_UTILS.getFileURL(f)) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression checkRemoteSensitivity(ftp.listFiles(),ftp.printWorkingDirectory()) is a void method call, and thus it cannot be parameterized
    Expression setURL(FILE_UTILS.getFileURL(f)) is a void method call, and thus it cannot be parameterized
    Expression checkRemoteSensitivity(ftp.listFiles(),ftp.printWorkingDirectory()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    • Inline private method checkRemoteSensitivity
    Expression setURL(FILE_UTILS.getFileURL(f)) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression checkRemoteSensitivity(ftp.listFiles(),ftp.printWorkingDirectory()) is a void method call, and thus it cannot be parameterized
    Expression setURL(FILE_UTILS.getFileURL(f)) is a void method call, and thus it cannot be parameterized
    2
    setURL(FILE_UTILS.getFileURL(f));
    Precondition Violations (8)
    Row Violation
    1Expression checkRemoteSensitivity(ftp.listFiles(),ftp.printWorkingDirectory()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression setURL(FILE_UTILS.getFileURL(f)) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression checkRemoteSensitivity(ftp.listFiles(),ftp.printWorkingDirectory()) is a void method call, and thus it cannot be parameterized
    4Expression setURL(FILE_UTILS.getFileURL(f)) is a void method call, and thus it cannot be parameterized
    5Expression checkRemoteSensitivity(ftp.listFiles(),ftp.printWorkingDirectory()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    6Expression setURL(FILE_UTILS.getFileURL(f)) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    7Expression checkRemoteSensitivity(ftp.listFiles(),ftp.printWorkingDirectory()) is a void method call, and thus it cannot be parameterized
    8Expression setURL(FILE_UTILS.getFileURL(f)) is a void method call, and thus it cannot be parameterized