if (args.length == 1) {
algo.reset();
update(args[0]);
}
IRubyObject digest = getDigestString();
if (args.length == 1) {
algo.reset();
}
return digest;
if (args.length == 1) {
algo.reset();
update(args[0]);
}
IRubyObject digest = getDigestHexString();
if (args.length == 1) {
algo.reset();
}
return digest;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyDigest.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyDigest.java
|
Method name: IRubyObject digest(IRubyObject[])
|
|
Method name: IRubyObject hexdigest(IRubyObject[])
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (args.length == 1) {↵ | | 1 | if (args.length == 1) {↵
|
2 | algo.reset();↵ | | 2 | algo.reset();↵
|
3 | update(args[0]);↵ | | 3 | update(args[0]);↵
|
4 | }↵ | | 4 | }↵
|
|
5 | IRubyObject digest = getDigestString();↵ | | 5 | IRubyObject digest = getDigestHexString();↵
|
|
6 | if (args.length == 1) {↵ | | 6 | if (args.length == 1) {↵
|
7 | algo.reset();↵ | | 7 | algo.reset();↵
|
8 | }↵ | | 8 | }↵
|
| | | 9 | ↵
|
9 | return digest; | | 10 | return digest;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 24 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (args.length == 1) | | 1 | if (args.length == 1) |
2 | | | 2 | |
3 | | | 3 | |
4 | IRubyObject digest = getDigestString(); | | 4 | IRubyObject digest = getDigestHexString(); |
5 | if (args.length == 1) | | 5 | if (args.length == 1) |
6 | | | 6 | |
7 | return digest; | | 7 | return digest; |
Precondition Violations (0)
Row |
Violation |