File path: /jruby-1.4.0/src/org/jruby/util/ClassCache.java | File path: /jruby-1.4.0/src/org/jruby/runtime/ObjectSpace.java | |||
Method name: void cleanup()
|
Method name: void cleanup()
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | KeyedClassReference reference;↵ | 1 | WeakReferenceListNode reference;↵ | |
2 | while ((reference = (KeyedClassReference)referenceQueue.poll()) != null) {↵ | 2 | while ((reference = (WeakReferenceListNode)deadReferences.poll()) != null) {↵ | |
3 | cache.remove(reference.getKey());↵ | 3 | reference.remove();↵ | |
4 | } | 4 |
| |
See real code fragment | See real code fragment |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
Number of mapped statements | 2 |
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) | 0.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | KeyedClassReference reference; |
| 1 | WeakReferenceListNode reference; | ||||||||||||||||
2 | while ((reference = (KeyedClassReference)referenceQueue.poll()) != null) |
| 2 | while ((reference = (WeakReferenceListNode)deadReferences.poll()) != null) | ||||||||||||||||
|
| 3 | reference.remove(); | |||||||||||||||||
3 | cache.remove(reference.getKey()); |
| |
Row | Violation |
---|---|
1 | Unmatched statement reference.remove(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement cache.remove(reference.getKey()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Clone fragment #1 returns variable reference with type org.jruby.util.ClassCache.KeyedClassReference , while Clone fragment #2 returns variable reference with type org.jruby.runtime.ObjectSpace.WeakReferenceListNode |