RubyClass proxy;
if ((proxy = proxyClass) != null) {
// proxy is complete, return it
return proxy;
} else if (proxyLock.isHeldByCurrentThread()) {
// proxy is under construction, building thread can
// safely read non-volatile value
return unfinishedProxyClass;
}
return null;
RubyModule proxy;
if ((proxy = proxyModule) != null) {
// proxy is complete, return it
return proxy;
} else if (proxyLock.isHeldByCurrentThread()) {
// proxy is under construction, building thread can
// safely read non-volatile value
return unfinishedProxyModule;
}
return null;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaClass.java
|
|
File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaClass.java
|
Method name: RubyClass getProxyClass()
|
|
Method name: RubyModule getProxyModule()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | RubyClass proxy;↵ | | 1 | RubyModule proxy;↵
|
2 | if ((proxy = proxyClass) != null) {↵ | | 2 | if ((proxy = proxyModule) != null) {↵
|
3 | // proxy is complete, return it↵ | | 3 | // proxy is complete, return it↵
|
4 | return proxy;↵ | | 4 | return proxy;↵
|
5 | } else if (proxyLock.isHeldByCurrentThread()) {↵ | | 5 | } else if (proxyLock.isHeldByCurrentThread()) {↵
|
6 | // proxy is under construction, building thread can↵ | | 6 | // proxy is under construction, building thread can↵
|
7 | // safely read non-volatile value↵ | | 7 | // safely read non-volatile value↵
|
8 | return unfinishedProxyClass; ↵ | | 8 | return unfinishedProxyModule; ↵
|
9 | }↵ | | 9 | }↵
|
10 | return null; | | 10 | return null;
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | RubyClass proxy; | | 1 | RubyModule proxy; |
2 | if ((proxy = proxyClass) != null) | | 2 | if ((proxy = proxyModule) != null) |
3 | | | 3 | |
4 | else if (proxyLock.isHeldByCurrentThread()) | | 4 | else if (proxyLock.isHeldByCurrentThread()) |
5 | return unfinishedProxyClass; | | 5 | return unfinishedProxyModule; |
6 | return null; | | 6 | return null; |
Precondition Violations (0)
Row |
Violation |