method.aload(StandardASMCompiler.THIS); // load all arguments straight through for (int i = 1; i <= 3; 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()); ChainedChildBodyCompiler methodCompiler = new ChainedChildBodyCompiler(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/ChildScopedBodyCompiler.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 <= 3; 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
        ChainedChildBodyCompiler methodCompiler = new ChainedChildBodyCompiler(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 cases0
Number of non-refactorable cases1
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. {Non-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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    method.aload(StandardASMCompiler.THIS);
    1
    method.aload(StandardASMCompiler.THIS);
    2
    for (int i = 1; i <= 3; i++)
    2
    for (int i = 1; i <= 3; i++)
    2
    for (int i = 1; i <= 4; i++)
    Differences
    Expression1Expression2Difference
    34LITERAL_VALUE_MISMATCH
    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
    ChainedChildBodyCompiler methodCompiler = new ChainedChildBodyCompiler(script, methodName, inspector, scope, this);
    6
    ChainedChildBodyCompiler methodCompiler = new ChainedChildBodyCompiler(script, methodName, inspector, scope, this);
    6
    ChainedChildBodyCompiler19 methodCompiler = new ChainedChildBodyCompiler19(script, methodName, inspector, scope, this);
    Differences
    Expression1Expression2Difference
    org.jruby.compiler.impl.ChainedChildBodyCompilerorg.jruby.compiler.impl.ChainedChildBodyCompiler19SUBCLASS_TYPE_MISMATCH
    org.jruby.compiler.impl.ChainedChildBodyCompilerorg.jruby.compiler.impl.ChainedChildBodyCompiler19SUBCLASS_TYPE_MISMATCH
    org.jruby.compiler.impl.ChainedChildBodyCompilerorg.jruby.compiler.impl.ChainedChildBodyCompiler19SUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new ChainedChildBodyCompiler(script,methodName,inspector,scope,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new ChainedChildBodyCompiler19(script,methodName,inspector,scope,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    ChainedChildBodyCompiler19 methodCompiler = new ChainedChildBodyCompiler19(script, methodName, inspector, scope, this);
    7
    methodCompiler.beginChainedMethod();
    7
    methodCompiler.beginChainedMethod();
    7
    methodCompiler.beginChainedMethod();
    Differences
    Expression1Expression2Difference
    org.jruby.compiler.impl.ChainedChildBodyCompilerorg.jruby.compiler.impl.ChainedChildBodyCompiler19SUBCLASS_TYPE_MISMATCH
    7
    methodCompiler.beginChainedMethod();
    8
    return methodCompiler;
    8
    return methodCompiler;
    8
    return methodCompiler;
    Differences
    Expression1Expression2Difference
    org.jruby.compiler.impl.ChainedChildBodyCompilerorg.jruby.compiler.impl.ChainedChildBodyCompiler19SUBCLASS_TYPE_MISMATCH
    8
    return methodCompiler;
    Precondition Violations (2)
    Row Violation
    1Expression new ChainedChildBodyCompiler(script,methodName,inspector,scope,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new ChainedChildBodyCompiler19(script,methodName,inspector,scope,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted