while (i.hasNext()) {
CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry> e =
((CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry>)i.next());
if (e.value == entry) {
result.append(RubyString.newUsAsciiStringShared(runtime, e.bytes, e.p, e.end - e.p).freeze(context));
}
}
while (i.hasNext()) {
CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry> e =
((CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry>)i.next());
if (e.value == entry) {
result.append(RubyString.newUsAsciiStringShared(runtime, e.bytes, e.p, e.end - e.p).freeze(context));
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyEncoding.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyEncoding.java
|
Method name: IRubyObject names(ThreadContext)
|
|
Method name: IRubyObject names(ThreadContext)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | while (i.hasNext()) {↵ | | 1 | while (i.hasNext()) {↵
|
2 | CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry> e = ↵ | | 2 | CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry> e = ↵
|
3 | ((CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry>)i.next());↵ | | 3 | ((CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry>)i.next());↵
|
4 | if (e.value == entry) {↵ | | 4 | if (e.value == entry) {↵
|
5 | result.append(RubyString.newUsAsciiStringShared(runtime, e.bytes, e.p, e.end - e.p).freeze(context));↵ | | 5 | result.append(RubyString.newUsAsciiStringShared(runtime, e.bytes, e.p, e.end - e.p).freeze(context));↵
|
6 | }↵ | | 6 | }↵
|
7 | } | | 7 | }
|
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 9 |
-
{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 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | while (i.hasNext()) | | 7 | while (i.hasNext()) |
13 | CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry> e = ((CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry>)i.next()); | | 8 | CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry> e = ((CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry>)i.next()); |
14 | | | 9 | |
15 | result.append(RubyString.newUsAsciiStringShared(runtime, e.bytes, e.p, e.end - e.p).freeze(context)); | | 10 | result.append(RubyString.newUsAsciiStringShared(runtime, e.bytes, e.p, e.end - e.p).freeze(context)); |
Precondition Violations (0)
Row |
Violation |