visitAll(new Visitor() { public void visit(IRubyObject key, IRubyObject value) { if (equalInternal(context, value, expected)) { throw new FoundKey(key); } } }); return null;
visitAll(new Visitor() { public void visit(IRubyObject key, IRubyObject value) { if (equalInternal(context, value, expected)) { throw FOUND; } } }); return false;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyHash.java File path: /jruby-1.4.0/src/org/jruby/RubyHash.java
Method name: IRubyObject internalIndex(ThreadContext, IRubyObject) Method name: boolean hasValue(ThreadContext, IRubyObject)
Number of AST nodes: 2 Number of AST nodes: 2
1
visitAll(new Visitor() {
1
visitAll(new Visitor() {
2
                public void visit(IRubyObject key, IRubyObject value) {
2
                public void visit(IRubyObject key, IRubyObject value) {
3
                    if (equalInternal(context, value, expected)) {
3
                    if (equalInternal(context, value, expected)) {
4
                        throw new FoundKey(key);
4
                        throw FOUND;
5
                    }
5
                    }
6
                }
6
                }
7
            });
7
            });
8
            return null;
8
            return false;
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.0
Clones locationClones are declared in the same class
Number of node comparisons4
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements1
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    visitAll(new Visitor() {...});
    2
    visitAll(new Visitor() {...});
    2
    visitAll(new Visitor() {...});
    Differences
    Expression1Expression2Difference
    new FoundKey(key)FOUNDTYPE_COMPATIBLE_REPLACEMENT
    2
    visitAll(new Visitor() {...});
    Precondition Violations (0)
    Row Violation