if (timeout == 0) { selector.selectNow(); } else { selector.select(timeout); }
if (newBuffer == null) { str.empty(); } else { str.setValue(newBuffer); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyIO.java File path: /jruby-1.4.0/src/org/jruby/RubyIO.java
Method name: IRubyObject select_static(ThreadContext, Ruby, IRubyObject[]) Method name: IRubyObject readNotAll(ThreadContext, OpenFile, int, RubyString)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (timeout == 0) {
1
if (newBuffer == null) {
2
                        selector.selectNow();
2
                    str.empty();
3
                    } else {
3
                } else {
4
                        selector.select(timeout);
4
                    
5
    
5
str.setValue(newBuffer);
6
                }
6
                }
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.2
Clones locationClones are declared in the same class
Number of node comparisons1