File path: /jruby-1.4.0/src/org/jruby/Ruby.java | File path: /jruby-1.4.0/src/org/jruby/Ruby.java | |||
Method name: void addFinalizer(Finalizable)
|
Method name: void addInternalFinalizer(Finalizable)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | synchronized (finalizersMutex) {↵ | 1 | synchronized (internalFinalizersMutex) {↵ | |
2 | if (finalizers == null) {↵ | 2 | if (internalFinalizers == null) {↵ | |
3 | finalizers = new WeakHashMap<Finalizable, Object>();↵ | 3 | internalFinalizers = new WeakHashMap<Finalizable, Object>();↵ | |
4 | }↵ | 4 | }↵ | |
5 | finalizers.put(finalizer, null);↵ | 5 | internalFinalizers.put(finalizer, null);↵ | |
6 | } | 6 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
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.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | synchronized (finalizersMutex) |
| 1 | synchronized (internalFinalizersMutex) | ||||||||||||
2 | if (finalizers == null) |
| 2 | if (internalFinalizers == null) | ||||||||||||
3 | finalizers = new WeakHashMap<Finalizable, Object>(); |
| 3 | internalFinalizers = new WeakHashMap<Finalizable, Object>(); | ||||||||||||
4 | finalizers.put(finalizer, null); |
| 4 | internalFinalizers.put(finalizer, null); |
Row | Violation |
---|---|
1 | Expression finalizers is a field being modified, and thus it cannot be parameterized |
2 | Expression internalFinalizers is a field being modified, and thus it cannot be parameterized |
3 | Expression finalizers cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression internalFinalizers cannot be parameterized, because it has dependencies to/from statements that will be extracted |