if(closed) { RubyClass errorClass = getRuntime().fastGetModule("Zlib").fastGetClass("GzipFile").fastGetClass("Error"); throw new RaiseException(RubyException.newException(getRuntime(), errorClass, "closed gzip stream")); } return orig_name == null ? getRuntime().getNil() : getRuntime().newString(orig_name);
if(closed) { RubyClass errorClass = getRuntime().fastGetModule("Zlib").fastGetClass("GzipFile").fastGetClass("Error"); throw new RaiseException(RubyException.newException(getRuntime(), errorClass, "closed gzip stream")); } return comment == null ? getRuntime().getNil() : RubyString.newString(getRuntime(), comment);
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/RubyZlib.java
Method name: IRubyObject orig_name() Method name: IRubyObject comment()
Number of AST nodes: 4 Number of AST nodes: 4
1
if(closed) {
1
if(closed) {
2
                RubyClass errorClass = getRuntime().fastGetModule("Zlib").fastGetClass("GzipFile").fastGetClass("Error");
2
                RubyClass errorClass = getRuntime().fastGetModule("Zlib").fastGetClass("GzipFile").fastGetClass("Error");
3
                throw new RaiseException(RubyException.newException(getRuntime(), errorClass, "closed gzip stream"));
3
                throw new RaiseException(RubyException.newException(getRuntime(), errorClass, "closed gzip stream"));
4
            }
4
            }
5
            return orig_name == null ? getRuntime().getNil() : getRuntime().newString(orig_name);
5
            return comment == null ? getRuntime().getNil() : RubyString.newString(getRuntime(), comment);
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.2
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (closed)
    1
    if (closed)
    2
    RubyClass errorClass = getRuntime().fastGetModule("Zlib").fastGetClass("GzipFile").fastGetClass("Error");
    2
    RubyClass errorClass = getRuntime().fastGetModule("Zlib").fastGetClass("GzipFile").fastGetClass("Error");
    3
    throw new RaiseException(RubyException.newException(getRuntime(), errorClass, "closed gzip stream"));
    3
    throw new RaiseException(RubyException.newException(getRuntime(), errorClass, "closed gzip stream"));
                                                                                                                                                                                                  
    4
    return comment == null ? getRuntime().getNil() : RubyString.newString(getRuntime(), comment);
    Preondition Violations
    Unmatched return comment == null ? getRuntime().getNil() : RubyString.newString(getRuntime(),comment);
    4
    return comment == null ? getRuntime().getNil() : RubyString.newString(getRuntime(), comment);
    4
    return orig_name == null ? getRuntime().getNil() : getRuntime().newString(orig_name);
    4
    return orig_name == null ? getRuntime().getNil() : getRuntime().newString(orig_name);
    Preondition Violations
    Unmatched return orig_name == null ? getRuntime().getNil() : getRuntime().newString(orig_name);
                                                                                                                                                                                    
    Precondition Violations (2)
    Row Violation
    1Unmatched return comment == null ? getRuntime().getNil() : RubyString.newString(getRuntime(),comment);
    2Unmatched return orig_name == null ? getRuntime().getNil() : getRuntime().newString(orig_name);