if (!remoteSensitivityChecked) { try { checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory()); } catch (IOException ioe) { throw new BuildException(ioe, getLocation()); } }
try { setExtraFields(ExtraFieldUtils.parse(extra)); } catch (Exception e) { throw new RuntimeException(e.getMessage()); }
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/zip/ZipEntry.java
Method name: void forceRemoteSensitivityCheck() Method name: void setExtra(byte[])
Number of AST nodes: 3 Number of AST nodes: 2
1
if (!remoteSensitivityChecked) {
2
                try {
1
try {
3
                    checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory());
2
            
4
       
3
setExtraFields(ExtraFieldUtils.parse(extra));
5
         } catch (IOException ioe) {
4
        } catch (Exception e) {
6
                    throw new BuildException(ioe, getLocation());
5
            throw new RuntimeException(
7
                }
8
    
6
e.getMessage());
9
        }
7
        }
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)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    1
    try
    Differences
    Expression1Expression2Difference
    java.io.IOExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    ioeeVARIABLE_NAME_MISMATCH
    java.io.IOExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.BuildExceptionjava.lang.RuntimeExceptionSUBCLASS_TYPE_MISMATCH
    new BuildException(ioe,getLocation())new RuntimeException(e.getMessage())ARGUMENT_NUMBER_MISMATCH
    1
    try
    3
    checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory());
    3
    checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory());
    2
    setExtraFields(ExtraFieldUtils.parse(extra));
    Differences
    Expression1Expression2Difference
    checkRemoteSensitivitysetExtraFieldsMETHOD_INVOCATION_NAME_MISMATCH
    checkRemoteSensitivity(ftp.listFiles(),ftp.printWorkingDirectory())setExtraFields(ExtraFieldUtils.parse(extra))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 setExtraFields(ExtraFieldUtils.parse(extra)) 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 setExtraFields(ExtraFieldUtils.parse(extra)) 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 setExtraFields(ExtraFieldUtils.parse(extra)) 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 setExtraFields(ExtraFieldUtils.parse(extra)) is a void method call, and thus it cannot be parameterized
    2
    setExtraFields(ExtraFieldUtils.parse(extra));
    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 setExtraFields(ExtraFieldUtils.parse(extra)) 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 setExtraFields(ExtraFieldUtils.parse(extra)) 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 setExtraFields(ExtraFieldUtils.parse(extra)) 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 setExtraFields(ExtraFieldUtils.parse(extra)) is a void method call, and thus it cannot be parameterized