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);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 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); |
4 | return orig_name == null ? getRuntime().getNil() : getRuntime().newString(orig_name); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched return comment == null ? getRuntime().getNil() : RubyString.newString(getRuntime(),comment); |
2 | Unmatched return orig_name == null ? getRuntime().getNil() : getRuntime().newString(orig_name); |