String defaultDateFormatConfig = task.getDefaultDateFormatConfig(); if (defaultDateFormatConfig != null) { config.setDefaultDateFormatStr(defaultDateFormatConfig); task.log("custom config: default date format = " + defaultDateFormatConfig, Project.MSG_VERBOSE); } String recentDateFormatConfig = task.getRecentDateFormatConfig(); if (recentDateFormatConfig != null) { config.setRecentDateFormatStr(recentDateFormatConfig); task.log("custom config: recent date format = " + recentDateFormatConfig, Project.MSG_VERBOSE); }
String serverTimeZoneConfig = task.getServerTimeZoneConfig(); if (serverTimeZoneConfig != null) { config.setServerTimeZoneId(serverTimeZoneConfig); task.log("custom config: server time zone ID = " + serverTimeZoneConfig, Project.MSG_VERBOSE); } String shortMonthNamesConfig = task.getShortMonthNamesConfig(); if (shortMonthNamesConfig != null) { config.setShortMonthNames(shortMonthNamesConfig); task.log("custom config: short month names = " + shortMonthNamesConfig, Project.MSG_VERBOSE); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/FTPConfigurator.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/FTPConfigurator.java
Method name: FTPClient configure(FTPClient, FTP) Method name: FTPClient configure(FTPClient, FTP)
Number of AST nodes: 8 Number of AST nodes: 8
1
String defaultDateFormatConfig = task.getDefaultDateFormatConfig();
1
String serverTimeZoneConfig = task.getServerTimeZoneConfig();
2
        if (defaultDateFormatConfig != null) {
2
        if (serverTimeZoneConfig != null) {
3
            config.setDefaultDateFormatStr(defaultDateFormatConfig);
3
            config.setServerTimeZoneId(serverTimeZoneConfig);
4
            task.log("custom config: default date format = "
4
            task.log("custom config: server time zone ID = "
5
                    + defaultDateFormatConfig, Project.MSG_VERBOSE);
5
                    + serverTimeZoneConfig, Project.MSG_VERBOSE);
6
        }
6
        }
7
        String recentDateFormatConfig = task.getRecentDateFormatConfig();
7
        String shortMonthNamesConfig = task.getShortMonthNamesConfig();
8
        if (recentDateFormatConfig != null) {
8
        if (shortMonthNamesConfig != null) {
9
            config.setRecentDateFormatStr(recentDateFormatConfig);
9
            config.setShortMonthNames(shortMonthNamesConfig);
10
            task.log("custom config: recent date format = "
10
            task.log("custom config: short month names = "
11
                    + recentDateFormatConfig, Project.MSG_VERBOSE);
11
                    + shortMonthNamesConfig, Project.MSG_VERBOSE);
12
        }
12
        }
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 in the same method
Number of node comparisons32
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)39.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    String defaultDateFormatConfig = task.getDefaultDateFormatConfig();
    9
    String defaultDateFormatConfig = task.getDefaultDateFormatConfig();
    21
    String serverTimeZoneConfig = task.getServerTimeZoneConfig();
    Differences
    Expression1Expression2Difference
    defaultDateFormatConfigserverTimeZoneConfigVARIABLE_NAME_MISMATCH
    getDefaultDateFormatConfiggetServerTimeZoneConfigMETHOD_INVOCATION_NAME_MISMATCH
    21
    String serverTimeZoneConfig = task.getServerTimeZoneConfig();
    10
    if (defaultDateFormatConfig != null)
    10
    if (defaultDateFormatConfig != null)
    22
    if (serverTimeZoneConfig != null)
    Differences
    Expression1Expression2Difference
    defaultDateFormatConfigserverTimeZoneConfigVARIABLE_NAME_MISMATCH
    22
    if (serverTimeZoneConfig != null)
    11
    config.setDefaultDateFormatStr(defaultDateFormatConfig);
    11
    config.setDefaultDateFormatStr(defaultDateFormatConfig);
    23
    config.setServerTimeZoneId(serverTimeZoneConfig);
    Differences
    Expression1Expression2Difference
    defaultDateFormatConfigserverTimeZoneConfigVARIABLE_NAME_MISMATCH
    setDefaultDateFormatStrsetServerTimeZoneIdMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression config.setDefaultDateFormatStr(defaultDateFormatConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.setServerTimeZoneId(serverTimeZoneConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.setDefaultDateFormatStr(defaultDateFormatConfig) is a void method call, and thus it cannot be parameterized
    Expression config.setServerTimeZoneId(serverTimeZoneConfig) is a void method call, and thus it cannot be parameterized
    23
    config.setServerTimeZoneId(serverTimeZoneConfig);
    12
    task.log("custom config: default date format = " + defaultDateFormatConfig, Project.MSG_VERBOSE);
    12
    task.log("custom config: default date format = " + defaultDateFormatConfig, Project.MSG_VERBOSE);
    24
    task.log("custom config: server time zone ID = " + serverTimeZoneConfig, Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    "custom config: default date format = ""custom config: server time zone ID = "LITERAL_VALUE_MISMATCH
    defaultDateFormatConfigserverTimeZoneConfigVARIABLE_NAME_MISMATCH
    24
    task.log("custom config: server time zone ID = " + serverTimeZoneConfig, Project.MSG_VERBOSE);
    13
    String recentDateFormatConfig = task.getRecentDateFormatConfig();
    13
    String recentDateFormatConfig = task.getRecentDateFormatConfig();
    25
    String shortMonthNamesConfig = task.getShortMonthNamesConfig();
    Differences
    Expression1Expression2Difference
    recentDateFormatConfigshortMonthNamesConfigVARIABLE_NAME_MISMATCH
    getRecentDateFormatConfiggetShortMonthNamesConfigMETHOD_INVOCATION_NAME_MISMATCH
    25
    String shortMonthNamesConfig = task.getShortMonthNamesConfig();
    14
    if (recentDateFormatConfig != null)
    14
    if (recentDateFormatConfig != null)
    26
    if (shortMonthNamesConfig != null)
    Differences
    Expression1Expression2Difference
    recentDateFormatConfigshortMonthNamesConfigVARIABLE_NAME_MISMATCH
    26
    if (shortMonthNamesConfig != null)
    15
    config.setRecentDateFormatStr(recentDateFormatConfig);
    15
    config.setRecentDateFormatStr(recentDateFormatConfig);
    27
    config.setShortMonthNames(shortMonthNamesConfig);
    Differences
    Expression1Expression2Difference
    recentDateFormatConfigshortMonthNamesConfigVARIABLE_NAME_MISMATCH
    setRecentDateFormatStrsetShortMonthNamesMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression config.setRecentDateFormatStr(recentDateFormatConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.setShortMonthNames(shortMonthNamesConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.setRecentDateFormatStr(recentDateFormatConfig) is a void method call, and thus it cannot be parameterized
    Expression config.setShortMonthNames(shortMonthNamesConfig) is a void method call, and thus it cannot be parameterized
    27
    config.setShortMonthNames(shortMonthNamesConfig);
    16
    task.log("custom config: recent date format = " + recentDateFormatConfig, Project.MSG_VERBOSE);
    16
    task.log("custom config: recent date format = " + recentDateFormatConfig, Project.MSG_VERBOSE);
    28
    task.log("custom config: short month names = " + shortMonthNamesConfig, Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    "custom config: recent date format = ""custom config: short month names = "LITERAL_VALUE_MISMATCH
    recentDateFormatConfigshortMonthNamesConfigVARIABLE_NAME_MISMATCH
    28
    task.log("custom config: short month names = " + shortMonthNamesConfig, Project.MSG_VERBOSE);
    Precondition Violations (8)
    Row Violation
    1Expression config.setDefaultDateFormatStr(defaultDateFormatConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression config.setServerTimeZoneId(serverTimeZoneConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression config.setDefaultDateFormatStr(defaultDateFormatConfig) is a void method call, and thus it cannot be parameterized
    4Expression config.setServerTimeZoneId(serverTimeZoneConfig) is a void method call, and thus it cannot be parameterized
    5Expression config.setRecentDateFormatStr(recentDateFormatConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression config.setShortMonthNames(shortMonthNamesConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression config.setRecentDateFormatStr(recentDateFormatConfig) is a void method call, and thus it cannot be parameterized
    8Expression config.setShortMonthNames(shortMonthNamesConfig) is a void method call, and thus it cannot be parameterized