method.aload(StandardASMCompiler.THIS); // load all arguments straight through for (int i = 1; i <= 4; i++) { method.aload(i); } // we append an index to ensure two identical method names will not conflict methodName = methodName + "_" + script.getAndIncrementMethodIndex(); method.invokestatic(script.getClassname(), methodName, getSignature()); ChainedChildBodyCompiler19 methodCompiler = new ChainedChildBodyCompiler19(script, methodName, inspector, scope, this); methodCompiler.beginChainedMethod(); return methodCompiler;
method.aload(StandardASMCompiler.THIS); // load all arguments straight through for (int i = 1; i <= 4; i++) { method.aload(i); } // we append an index to ensure two identical method names will not conflict methodName = methodName + "_" + script.getAndIncrementMethodIndex(); method.invokestatic(script.getClassname(), methodName, getSignature()); ChainedChildBodyCompiler19 methodCompiler = new ChainedChildBodyCompiler19(script, methodName, inspector, scope, this); methodCompiler.beginChainedMethod(); return methodCompiler;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/impl/ChainedChildBodyCompiler19.java File path: /jruby-1.4.0/src/org/jruby/compiler/impl/ChildScopedBodyCompiler19.java
Method name: ChainedChildBodyCompiler outline(String) Method name: ChainedChildBodyCompiler outline(String)
Number of AST nodes: 8 Number of AST nodes: 8
1
method.aload(StandardASMCompiler.THIS);
1
method.aload(StandardASMCompiler.THIS);
2
        // load all arguments straight through
2
        // load all arguments straight through
3
        for (int i = 1; i <= 4; i++) {
3
        for (int i = 1; i <= 4; i++) {
4
            method.aload(i);
4
            method.aload(i);
5
        }
5
        }
6
        // we append an index to ensure two identical method names will not conflict
6
        // we append an index to ensure two identical method names will not conflict
7
        methodName = methodName + "_" + script.getAndIncrementMethodIndex();
7
        methodName = methodName + "_" + script.getAndIncrementMethodIndex();
8
        method.invokestatic(script.getClassname(), methodName, getSignature());
8
        method.invokestatic(script.getClassname(), methodName, getSignature());
9
        ChainedChildBodyCompiler19 methodCompiler = new ChainedChildBodyCompiler19(script, methodName, inspector, scope, this);
9
        ChainedChildBodyCompiler19 methodCompiler = new ChainedChildBodyCompiler19(script, methodName, inspector, scope, this);
10
        methodCompiler.beginChainedMethod();
10
        methodCompiler.beginChainedMethod();
11
        return methodCompiler;
11
        return methodCompiler;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons30
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.4
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    method.aload(StandardASMCompiler.THIS);
    1
    method.aload(StandardASMCompiler.THIS);
    2
    for (int i = 1; i <= 4; i++)
    2
    for (int i = 1; i <= 4; i++)
    3
    method.aload(i);
    3
    method.aload(i);
    4
    methodName = methodName + "_" + script.getAndIncrementMethodIndex();
    4
    methodName = methodName + "_" + script.getAndIncrementMethodIndex();
    5
    method.invokestatic(script.getClassname(), methodName, getSignature());
    5
    method.invokestatic(script.getClassname(), methodName, getSignature());
    6
    ChainedChildBodyCompiler19 methodCompiler = new ChainedChildBodyCompiler19(script, methodName, inspector, scope, this);
    6
    ChainedChildBodyCompiler19 methodCompiler = new ChainedChildBodyCompiler19(script, methodName, inspector, scope, this);
    7
    methodCompiler.beginChainedMethod();
    7
    methodCompiler.beginChainedMethod();
    8
    return methodCompiler;
    8
    return methodCompiler;
    Precondition Violations (0)
    Row Violation