String country = locale.getCountry().length() > 0 ? "_" + locale.getCountry() : ""; String variant = locale.getVariant().length() > 0 ? "_" + locale.getVariant() : "";
String language = locale.getLanguage().length() > 0 ? "_" + locale.getLanguage() : ""; String country = locale.getCountry().length() > 0 ? "_" + locale.getCountry() : "";
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
String country = locale.getCountry().length() > 0
1
String language = locale.getLanguage().length() > 0
2
            ? "_" + locale.getCountry() : "";
2
            ? "_" + locale.getLanguage() : "";
3
        String variant = locale.getVariant().length() > 0
3
        String country = locale.getCountry().length() > 0
4
            ? "_" + locale.getVariant() : "";
4
            ? "_" + locale.getCountry() : "";
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
    3
    String country = locale.getCountry().length() > 0 ? "_" + locale.getCountry() : "";
    3
    String country = locale.getCountry().length() > 0 ? "_" + locale.getCountry() : "";
    4
    String variant = locale.getVariant().length() > 0 ? "_" + locale.getVariant() : "";
    4
    String variant = locale.getVariant().length() > 0 ? "_" + locale.getVariant() : "";
    2
    String language = locale.getLanguage().length() > 0 ? "_" + locale.getLanguage() : "";
    Differences
    Expression1Expression2Difference
    variantlanguageVARIABLE_NAME_MISMATCH
    getVariantgetLanguageMETHOD_INVOCATION_NAME_MISMATCH
    getVariantgetLanguageMETHOD_INVOCATION_NAME_MISMATCH
    2
    String language = locale.getLanguage().length() > 0 ? "_" + locale.getLanguage() : "";
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables country, variant , while Clone fragment #2 returns variables language, country