Encoding enc = isCompatibleWith(other);
if (enc == null) throw getRuntime().newEncodingCompatibilityError("incompatible character encodings: " +
value.encoding + " and " + other.getEncoding());
return enc;
Encoding enc = isCompatibleWith(other);
if (enc == null) throw getRuntime().newEncodingCompatibilityError("incompatible character encodings: " +
value.encoding + " and " + other.value.encoding);
return enc;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyString.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyString.java
|
Method name: Encoding checkEncoding(EncodingCapable)
|
|
Method name: Encoding checkEncoding(RubyString)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | Encoding enc = isCompatibleWith(other);↵ | | 1 | Encoding enc = isCompatibleWith(other);↵
|
2 | if (enc == null) throw getRuntime().newEncodingCompatibilityError("incompatible character encodings: " + ↵ | | 2 | if (enc == null) throw getRuntime().newEncodingCompatibilityError("incompatible character encodings: " + ↵
|
3 | value.encoding + " and " + other.getEncoding());↵ | | 3 | value.encoding + " and " + other.value.encoding);↵
|
4 | return enc; | | 4 | return enc;
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Encoding enc = isCompatibleWith(other); | | 1 | Encoding enc = isCompatibleWith(other); |
2 | if (enc == null) | | 2 | if (enc == null) |
3 | throw getRuntime().newEncodingCompatibilityError("incompatible character encodings: " + value.encoding + " and " + other.getEncoding()); | | 3 | throw getRuntime().newEncodingCompatibilityError("incompatible character encodings: " + value.encoding + " and " + other.value.encoding); |
4 | return enc; | | 4 | return enc; |
Precondition Violations (1)
Row |
Violation |
1 | Type org.jruby.runtime.encoding.EncodingCapable of variable other does not match with type org.jruby.RubyString of variable other |