if (scope.getNumberOfVariables() > 4) {
method.aload(methodCompiler.getDynamicScopeIndex());
method.invokevirtual(p(DynamicScope.class), "getValues", sig(IRubyObject[].class));
method.astore(methodCompiler.getVarsArrayIndex());
}
if (scope.getNumberOfVariables() > 4) {
method.aload(methodCompiler.getDynamicScopeIndex());
method.invokevirtual(p(DynamicScope.class), "getValues", sig(IRubyObject[].class));
method.astore(methodCompiler.getVarsArrayIndex());
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/impl/HeapBasedVariableCompiler.java
|
|
File path: /jruby-1.4.0/src/org/jruby/compiler/impl/HeapBasedVariableCompiler.java
|
Method name: void beginClass(CompilerCallback, StaticScope)
|
|
Method name: void beginFlatClosure(CompilerCallback, StaticScope)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (scope.getNumberOfVariables() > 4) {↵ | | 1 | if (scope.getNumberOfVariables() > 4) {↵
|
2 | method.aload(methodCompiler.getDynamicScopeIndex());↵ | | 2 | method.aload(methodCompiler.getDynamicScopeIndex());↵
|
3 | method.invokevirtual(p(DynamicScope.class), "getValues", sig(IRubyObject[].class));↵ | | 3 | method.invokevirtual(p(DynamicScope.class), "getValues", sig(IRubyObject[].class));↵
|
4 | method.astore(methodCompiler.getVarsArrayIndex());↵ | | 4 | method.astore(methodCompiler.getVarsArrayIndex());↵
|
5 | } | | 5 | }
|
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 declared in the same class |
Number of node comparisons | 16 |
-
{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.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
11 | if (scope.getNumberOfVariables() > 4) | | 4 | if (scope.getNumberOfVariables() > 4) |
12 | method.aload(methodCompiler.getDynamicScopeIndex()); | | 5 | method.aload(methodCompiler.getDynamicScopeIndex()); |
13 | method.invokevirtual(p(DynamicScope.class), "getValues", sig(IRubyObject[].class)); | | 6 | method.invokevirtual(p(DynamicScope.class), "getValues", sig(IRubyObject[].class)); |
14 | method.astore(methodCompiler.getVarsArrayIndex()); | | 7 | method.astore(methodCompiler.getVarsArrayIndex()); |
Precondition Violations (0)
Row |
Violation |