boolean isTrace = runtime.hasEventHooks();
try {
if (isTrace) {
// XXX Wrong, but will have to do for now
runtime.callEventHooks(context, RubyEvent.CALL, context.getFile(), context.getLine(), name, getImplementationClass());
}
return (IRubyObject)method.invoke(null, $scriptObject, context, self, args, block);
} finally {
if (isTrace) {
Frame frame = context.getPreviousFrame();
runtime.callEventHooks(context, RubyEvent.RETURN, frame.getFile(), frame.getLine(), name, getImplementationClass());
}
}
boolean isTrace = runtime.hasEventHooks();
try {
if (isTrace) {
runtime.callEventHooks(context, RubyEvent.C_CALL, context.getFile(), context.getLine(), name, getImplementationClass());
}
return (IRubyObject)method.invoke(self, (Object[])args);
} finally {
if (isTrace) {
runtime.callEventHooks(context, RubyEvent.C_RETURN, context.getFile(), context.getLine(), name, getImplementationClass());
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/internal/runtime/methods/ReflectedCompiledMethod.java
|
|
File path: /jruby-1.4.0/src/org/jruby/internal/runtime/methods/ReflectedJavaMethod.java
|
Method name: IRubyObject call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject[], Block)
|
|
Method name: IRubyObject call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject[], Block)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | boolean isTrace = runtime.hasEventHooks();↵ | | 1 | boolean isTrace = runtime.hasEventHooks();↵
|
2 | try {↵ | | 2 | try {↵
|
3 | if (isTrace) {↵ | | 3 | if (isTrace) {↵
|
4 | // XXX Wrong, but will have to do for now↵ | | 4 | ↵
|
5 | runtime.callEventHooks(context, RubyEvent.CALL, context.getFile(), context.getLine(), name, getImplementationClass());↵ | | 5 | runtime.callEventHooks(context, RubyEvent.C_CALL, context.getFile(), context.getLine(), name, getImplementationClass());↵
|
6 | }↵ | | 6 | ↵
|
| | | 7 | } ↵
|
7 | return (IRubyObject)method.invoke(null, $scriptObject, context, self, args, block);↵ | | 8 | return (IRubyObject)method.invoke(↵
|
| | | 9 | self, (Object[])args);↵
|
8 | } finally {↵ | | 10 | } finally {↵
|
9 | if (isTrace) {↵ | | 11 | if (isTrace) {↵
|
10 | Frame frame = context.getPreviousFrame();↵ | | 12 | ↵
|
|
11 | runtime.callEventHooks(context, RubyEvent.RETURN, frame.getFile(), frame.getLine(), name, getImplementationClass());↵ | | 13 | runtime.callEventHooks(context, RubyEvent.C_RETURN, context.getFile(), context.getLine(), name, getImplementationClass());↵
|
12 | }↵ | | 14 | ↵
|
| | | 15 | }↵
|
13 | } | | 16 | }
|
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
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) | 0.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | if (isTrace) | | 10 | if (isTrace) |
7 | runtime.callEventHooks(context, RubyEvent.CALL, context.getFile(), context.getLine(), name, getImplementationClass()); | | 11 | runtime.callEventHooks(context, RubyEvent.C_CALL, context.getFile(), context.getLine(), name, getImplementationClass()); |
Precondition Violations (0)
Row |
Violation |