for (Map.Entry<String, NamedInstaller> entry : staticCallbacks.entrySet()) { if (entry.getValue().type == NamedInstaller.STATIC_METHOD && entry.getValue().hasLocalMethod()) { assignAliases((MethodInstaller) entry.getValue(), staticNames); } }
for (Map.Entry<String, NamedInstaller> entry : instanceCallbacks.entrySet()) { if (entry.getValue().type == NamedInstaller.INSTANCE_METHOD && entry.getValue().hasLocalMethod()) { assignAliases((MethodInstaller) entry.getValue(), instanceNames); } }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaClass.java File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaClass.java
Method name: void setupClassMethods(Class, Map, Map, Map, Map) Method name: void setupClassMethods(Class, Map, Map, Map, Map)
Number of AST nodes: 3 Number of AST nodes: 3
1
for (Map.Entry<String, NamedInstaller> entry : staticCallbacks.entrySet()) {
1
for (Map.Entry<String, NamedInstaller> entry : instanceCallbacks.entrySet()) {
2
            if (entry.getValue().type == NamedInstaller.STATIC_METHOD && entry.getValue().hasLocalMethod()) {
2
            if (entry.getValue().type == NamedInstaller.INSTANCE_METHOD && entry.getValue().hasLocalMethod()) {
3
                assignAliases((MethodInstaller) entry.getValue(), staticNames);
3
                assignAliases((MethodInstaller) entry.getValue(), instanceNames);
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.6
Clones locationClones are in the same method
Number of node comparisons8
  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)12.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    28
    for (Map.Entry<String, NamedInstaller> entry : staticCallbacks.entrySet())
    28
    for (Map.Entry<String, NamedInstaller> entry : staticCallbacks.entrySet())
    31
    for (Map.Entry<String, NamedInstaller> entry : instanceCallbacks.entrySet())
    Differences
    Expression1Expression2Difference
    staticCallbacksinstanceCallbacksVARIABLE_NAME_MISMATCH
    31
    for (Map.Entry<String, NamedInstaller> entry : instanceCallbacks.entrySet())
    29
    if (entry.getValue().type == NamedInstaller.STATIC_METHOD && entry.getValue().hasLocalMethod())
    29
    if (entry.getValue().type == NamedInstaller.STATIC_METHOD && entry.getValue().hasLocalMethod())
    32
    if (entry.getValue().type == NamedInstaller.INSTANCE_METHOD && entry.getValue().hasLocalMethod())
    Differences
    Expression1Expression2Difference
    STATIC_METHODINSTANCE_METHODVARIABLE_NAME_MISMATCH
    32
    if (entry.getValue().type == NamedInstaller.INSTANCE_METHOD && entry.getValue().hasLocalMethod())
    30
    assignAliases((MethodInstaller)entry.getValue(), staticNames);
    30
    assignAliases((MethodInstaller)entry.getValue(), staticNames);
    33
    assignAliases((MethodInstaller)entry.getValue(), instanceNames);
    Differences
    Expression1Expression2Difference
    staticNamesinstanceNamesVARIABLE_NAME_MISMATCH
    33
    assignAliases((MethodInstaller)entry.getValue(), instanceNames);
    Precondition Violations (0)
    Row Violation