language = locale.getLanguage().length() > 0 ? "_" + locale.getLanguage() : ""; country = locale.getCountry().length() > 0 ? "_" + locale.getCountry() : "";
country = locale.getCountry().length() > 0 ? "_" + locale.getCountry() : ""; variant = locale.getVariant().length() > 0 ? "_" + locale.getVariant() : "";
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java
Method name: void loadResourceMaps() Method name: void loadResourceMaps()
Number of AST nodes: 2 Number of AST nodes: 2
1
language = locale.getLanguage().length() > 0
1
country = locale.getCountry().length() > 0
2
            ? "_" + locale.getLanguage() : "";
2
            ? "_" + locale.getCountry() : "";
3
        country = locale.getCountry().length() > 0
3
        variant = locale.getVariant().length() > 0
4
            ? "_" + locale.getCountry() : "";
4
            ? "_" + locale.getVariant() : "";
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.0
Clones locationClones are in the same method
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)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    language = locale.getLanguage().length() > 0 ? "_" + locale.getLanguage() : "";
    14
    language = locale.getLanguage().length() > 0 ? "_" + locale.getLanguage() : "";
    16
    variant = locale.getVariant().length() > 0 ? "_" + locale.getVariant() : "";
    Differences
    Expression1Expression2Difference
    languagevariantVARIABLE_NAME_MISMATCH
    getLanguagegetVariantMETHOD_INVOCATION_NAME_MISMATCH
    getLanguagegetVariantMETHOD_INVOCATION_NAME_MISMATCH
    16
    variant = locale.getVariant().length() > 0 ? "_" + locale.getVariant() : "";
    15
    country = locale.getCountry().length() > 0 ? "_" + locale.getCountry() : "";
    15
    country = locale.getCountry().length() > 0 ? "_" + locale.getCountry() : "";
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables language, country , while Clone fragment #2 returns variables country, variant