for (Map.Entry<String, RubyClass.VariableAccessor> entry : ivarAccessors.entrySet()) { Object value = entry.getValue().get(this); if (value == null) continue; list.add(new VariableEntry<Object>(entry.getKey(), value)); }
for (Map.Entry<String, RubyClass.VariableAccessor> entry : ivarAccessors.entrySet()) { Object value = entry.getValue().get(this); if (value == null) continue; list.add(entry.getKey()); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyBasicObject.java File path: /jruby-1.4.0/src/org/jruby/RubyBasicObject.java
Method name: List> getVariableList() Method name: List getVariableNameList()
Number of AST nodes: 5 Number of AST nodes: 5
1
for (Map.Entry<String, RubyClass.VariableAccessor> entry : ivarAccessors.entrySet()) {
1
for (Map.Entry<String, RubyClass.VariableAccessor> entry : ivarAccessors.entrySet()) {
2
            Object value = entry.getValue().get(this);
2
            Object value = entry.getValue().get(this);
3
            if (value == null) continue;
3
            if (value == null) continue;
4
            list.add(new VariableEntry<Object>(entry.getKey(), value));
4
            list.add(entry.getKey());
5
        }
5
        }
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 declared in the same class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    for (Map.Entry<String, RubyClass.VariableAccessor> entry : ivarAccessors.entrySet())
    3
    for (Map.Entry<String, RubyClass.VariableAccessor> entry : ivarAccessors.entrySet())
    4
    Object value = entry.getValue().get(this);
    4
    Object value = entry.getValue().get(this);
    5
    if (value == null)
    5
    if (value == null)
    6
    continue;
    6
    continue;
                                                            
    7
    list.add(entry.getKey());
    Preondition Violations
    Unmatched statement list.add(entry.getKey()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    list.add(entry.getKey());
    7
    list.add(new VariableEntry<Object>(entry.getKey(), value));
    7
    list.add(new VariableEntry<Object>(entry.getKey(), value));
    Preondition Violations
    Unmatched statement list.add(new VariableEntry<Object>(entry.getKey(),value)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                              
    Precondition Violations (3)
    Row Violation
    1Unmatched statement list.add(entry.getKey()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement list.add(new VariableEntry<Object>(entry.getKey(),value)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables entry, value , while Clone fragment #2 returns variables entry