for (String s : ARCH_NAMES.keySet()) { if (s.equalsIgnoreCase(arch)) { return ARCH_NAMES.get(s); } }
for (String s : OS_NAMES.keySet()) { if (s.equalsIgnoreCase(osname)) { return OS_NAMES.get(s); } }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/platform/Platform.java File path: /jruby-1.4.0/src/org/jruby/platform/Platform.java
Method name: String initArchitecture() Method name: String initOperatingSystem()
Number of AST nodes: 3 Number of AST nodes: 3
1
for (String s : ARCH_NAMES.keySet()) {
1
for (String s : OS_NAMES.keySet()) {
2
            if (s.equalsIgnoreCase(arch)) {
2
            if (s.equalsIgnoreCase(osname)) {
3
                return ARCH_NAMES.get(s);
3
                return OS_NAMES.get(s);
4
            }
4
            }
5
        }
5
        }
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 declared in the same class
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (String s : ARCH_NAMES.keySet())
    2
    for (String s : ARCH_NAMES.keySet())
    2
    for (String s : OS_NAMES.keySet())
    Differences
    Expression1Expression2Difference
    ARCH_NAMESOS_NAMESVARIABLE_NAME_MISMATCH
    2
    for (String s : OS_NAMES.keySet())
    3
    if (s.equalsIgnoreCase(arch))
    3
    if (s.equalsIgnoreCase(arch))
    3
    if (s.equalsIgnoreCase(osname))
    Differences
    Expression1Expression2Difference
    archosnameVARIABLE_NAME_MISMATCH
    3
    if (s.equalsIgnoreCase(osname))
    4
    return ARCH_NAMES.get(s);
    4
    return ARCH_NAMES.get(s);
    4
    return OS_NAMES.get(s);
    Differences
    Expression1Expression2Difference
    ARCH_NAMESOS_NAMESVARIABLE_NAME_MISMATCH
    4
    return OS_NAMES.get(s);
    Precondition Violations (0)
    Row Violation