String serverLanguageCodeConfig = task.getServerLanguageCodeConfig(); if (serverLanguageCodeConfig != null) { config.setServerLanguageCode(serverLanguageCodeConfig); task.log("custom config: server language code = " + serverLanguageCodeConfig, 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); }
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 serverLanguageCodeConfig = task.getServerLanguageCodeConfig(); if (serverLanguageCodeConfig != null) { config.setServerLanguageCode(serverLanguageCodeConfig); task.log("custom config: server language code = " + serverLanguageCodeConfig, 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: 12 Number of AST nodes: 12
1
String serverLanguageCodeConfig = task.getServerLanguageCodeConfig();
1
String defaultDateFormatConfig = task.getDefaultDateFormatConfig();
2
        if (serverLanguageCodeConfig != null) {
2
        if (defaultDateFormatConfig != null) {
3
            config.setServerLanguageCode(serverLanguageCodeConfig);
3
            config.setDefaultDateFormatStr(defaultDateFormatConfig);
4
            task.log("custom config: server language code = "
4
            task.log("custom config: default date format = "
5
                    + serverLanguageCodeConfig, Project.MSG_VERBOSE);
5
                    + defaultDateFormatConfig, Project.MSG_VERBOSE);
6
        }
6
        }
7
        String serverTimeZoneConfig = task.getServerTimeZoneConfig();
7
        String recentDateFormatConfig = task.getRecentDateFormatConfig();
8
        if (serverTimeZoneConfig != null) {
8
        if (recentDateFormatConfig != null) {
9
            config.setServerTimeZoneId(serverTimeZoneConfig);
9
            config.setRecentDateFormatStr(recentDateFormatConfig);
10
            task.log("custom config: server time zone ID = "
10
            task.log("custom config: recent date format = "
11
                    + serverTimeZoneConfig, Project.MSG_VERBOSE);
11
                    + recentDateFormatConfig, Project.MSG_VERBOSE);
12
        }
12
        }
13
        String shortMonthNamesConfig = task.getShortMonthNamesConfig();
13
        String serverLanguageCodeConfig = task.getServerLanguageCodeConfig();
14
        if (shortMonthNamesConfig != null) {
14
        if (serverLanguageCodeConfig != null) {
15
            config.setShortMonthNames(shortMonthNamesConfig);
15
            config.setServerLanguageCode(serverLanguageCodeConfig);
16
            task.log("custom config: short month names = "
16
            task.log("custom config: server language code = "
17
                    + shortMonthNamesConfig, Project.MSG_VERBOSE);
17
                    + serverLanguageCodeConfig, Project.MSG_VERBOSE);
18
        }
18
        }
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 in the same method
Number of node comparisons66
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    17
    String serverLanguageCodeConfig = task.getServerLanguageCodeConfig();
    17
    String serverLanguageCodeConfig = task.getServerLanguageCodeConfig();
    18
    if (serverLanguageCodeConfig != null)
    18
    if (serverLanguageCodeConfig != null)
    19
    config.setServerLanguageCode(serverLanguageCodeConfig);
    19
    config.setServerLanguageCode(serverLanguageCodeConfig);
    20
    task.log("custom config: server language code = " + serverLanguageCodeConfig, Project.MSG_VERBOSE);
    20
    task.log("custom config: server language code = " + serverLanguageCodeConfig, Project.MSG_VERBOSE);
    21
    String serverTimeZoneConfig = task.getServerTimeZoneConfig();
    21
    String serverTimeZoneConfig = task.getServerTimeZoneConfig();
    13
    String recentDateFormatConfig = task.getRecentDateFormatConfig();
    Differences
    Expression1Expression2Difference
    serverTimeZoneConfigrecentDateFormatConfigVARIABLE_NAME_MISMATCH
    getServerTimeZoneConfiggetRecentDateFormatConfigMETHOD_INVOCATION_NAME_MISMATCH
    13
    String recentDateFormatConfig = task.getRecentDateFormatConfig();
    22
    if (serverTimeZoneConfig != null)
    22
    if (serverTimeZoneConfig != null)
    14
    if (recentDateFormatConfig != null)
    Differences
    Expression1Expression2Difference
    serverTimeZoneConfigrecentDateFormatConfigVARIABLE_NAME_MISMATCH
    14
    if (recentDateFormatConfig != null)
    23
    config.setServerTimeZoneId(serverTimeZoneConfig);
    23
    config.setServerTimeZoneId(serverTimeZoneConfig);
    15
    config.setRecentDateFormatStr(recentDateFormatConfig);
    Differences
    Expression1Expression2Difference
    setServerTimeZoneIdsetRecentDateFormatStrMETHOD_INVOCATION_NAME_MISMATCH
    serverTimeZoneConfigrecentDateFormatConfigVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression config.setServerTimeZoneId(serverTimeZoneConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.setRecentDateFormatStr(recentDateFormatConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.setServerTimeZoneId(serverTimeZoneConfig) is a void method call, and thus it cannot be parameterized
    Expression config.setRecentDateFormatStr(recentDateFormatConfig) is a void method call, and thus it cannot be parameterized
    15
    config.setRecentDateFormatStr(recentDateFormatConfig);
    24
    task.log("custom config: server time zone ID = " + serverTimeZoneConfig, Project.MSG_VERBOSE);
    24
    task.log("custom config: server time zone ID = " + serverTimeZoneConfig, Project.MSG_VERBOSE);
    16
    task.log("custom config: recent date format = " + recentDateFormatConfig, Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    "custom config: server time zone ID = ""custom config: recent date format = "LITERAL_VALUE_MISMATCH
    serverTimeZoneConfigrecentDateFormatConfigVARIABLE_NAME_MISMATCH
    16
    task.log("custom config: recent date format = " + recentDateFormatConfig, Project.MSG_VERBOSE);
    25
    String shortMonthNamesConfig = task.getShortMonthNamesConfig();
    25
    String shortMonthNamesConfig = task.getShortMonthNamesConfig();
    9
    String defaultDateFormatConfig = task.getDefaultDateFormatConfig();
    Differences
    Expression1Expression2Difference
    shortMonthNamesConfigdefaultDateFormatConfigVARIABLE_NAME_MISMATCH
    getShortMonthNamesConfiggetDefaultDateFormatConfigMETHOD_INVOCATION_NAME_MISMATCH
    9
    String defaultDateFormatConfig = task.getDefaultDateFormatConfig();
    26
    if (shortMonthNamesConfig != null)
    26
    if (shortMonthNamesConfig != null)
    10
    if (defaultDateFormatConfig != null)
    Differences
    Expression1Expression2Difference
    shortMonthNamesConfigdefaultDateFormatConfigVARIABLE_NAME_MISMATCH
    10
    if (defaultDateFormatConfig != null)
    27
    config.setShortMonthNames(shortMonthNamesConfig);
    27
    config.setShortMonthNames(shortMonthNamesConfig);
    11
    config.setDefaultDateFormatStr(defaultDateFormatConfig);
    Differences
    Expression1Expression2Difference
    setShortMonthNamessetDefaultDateFormatStrMETHOD_INVOCATION_NAME_MISMATCH
    shortMonthNamesConfigdefaultDateFormatConfigVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression config.setShortMonthNames(shortMonthNamesConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.setDefaultDateFormatStr(defaultDateFormatConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.setShortMonthNames(shortMonthNamesConfig) is a void method call, and thus it cannot be parameterized
    Expression config.setDefaultDateFormatStr(defaultDateFormatConfig) is a void method call, and thus it cannot be parameterized
    11
    config.setDefaultDateFormatStr(defaultDateFormatConfig);
    28
    task.log("custom config: short month names = " + shortMonthNamesConfig, Project.MSG_VERBOSE);
    28
    task.log("custom config: short month names = " + shortMonthNamesConfig, Project.MSG_VERBOSE);
    12
    task.log("custom config: default date format = " + defaultDateFormatConfig, Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    "custom config: short month names = ""custom config: default date format = "LITERAL_VALUE_MISMATCH
    shortMonthNamesConfigdefaultDateFormatConfigVARIABLE_NAME_MISMATCH
    12
    task.log("custom config: default date format = " + defaultDateFormatConfig, Project.MSG_VERBOSE);
    Precondition Violations (8)
    Row Violation
    1Expression config.setServerTimeZoneId(serverTimeZoneConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression config.setRecentDateFormatStr(recentDateFormatConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression config.setServerTimeZoneId(serverTimeZoneConfig) is a void method call, and thus it cannot be parameterized
    4Expression config.setRecentDateFormatStr(recentDateFormatConfig) is a void method call, and thus it cannot be parameterized
    5Expression config.setShortMonthNames(shortMonthNamesConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression config.setDefaultDateFormatStr(defaultDateFormatConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression config.setShortMonthNames(shortMonthNamesConfig) is a void method call, and thus it cannot be parameterized
    8Expression config.setDefaultDateFormatStr(defaultDateFormatConfig) is a void method call, and thus it cannot be parameterized