if (block.isGiven()) { try { return block.yield(context, instance); } finally { if (!instance.isClosed()) instance.close(); } }
try { return block.yield(context, ptr); } finally { io.free(); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyZlib.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/MemoryPointer.java
Method name: IRubyObject wrapBlock(ThreadContext, RubyGzipFile, Block) Method name: IRubyObject allocate(ThreadContext, IRubyObject, IRubyObject, int, int, boolean, Block)
Number of AST nodes: 3 Number of AST nodes: 2
1
if (block.isGiven()) {
2
                try {
1
try {
3
                    return block.yield(context, instance);
2
                return block.yield(context, 
4
    
3
ptr);
5
            } finally {
4
            } finally {
6
                    if (!instance.isClosed()) instance.close();
5
                
7
                }
6
io.free();
8
            }
7
            }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes having the same super class
Number of node comparisons1