final OpAsgnNode opAsgnNode = (OpAsgnNode) node; final CompilerCallback receiverCallback = new CompilerCallback() { public void call(BodyCompiler context) { compile(opAsgnNode.getReceiverNode(), context, true); // [recv] } }; ArgumentsCallback argsCallback = getArgsCallback(opAsgnNode.getValueNode()); context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback); // TODO: don't require pop if (!expr) context.consumeCurrentValue();
final OpAsgnNode opAsgnNode = (OpAsgnNode) node; final CompilerCallback receiverCallback = new CompilerCallback() { public void call(BodyCompiler context) { compile(opAsgnNode.getReceiverNode(), context, true); // [recv] } }; ArgumentsCallback argsCallback = getArgsCallback(opAsgnNode.getValueNode()); context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback); // TODO: don't require pop if (!expr) context.consumeCurrentValue();
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java
Method name: void compileOpAsgnWithAnd(Node, BodyCompiler, boolean) Method name: void compileOpAsgnWithOr(Node, BodyCompiler, boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
final OpAsgnNode opAsgnNode = (OpAsgnNode) node;
1
final OpAsgnNode opAsgnNode = (OpAsgnNode) node;
2
        final CompilerCallback receiverCallback = new CompilerCallback() {
2
        final CompilerCallback receiverCallback = new CompilerCallback() {
3
            public void call(BodyCompiler context) {
3
            public void call(BodyCompiler context) {
4
                compile(opAsgnNode.getReceiverNode(), context, true); // [recv]
4
                compile(opAsgnNode.getReceiverNode(), context, true); // [recv]
5
            }
5
            }
6
        };
6
        };
7
        
7
        
8
        ArgumentsCallback argsCallback = getArgsCallback(opAsgnNode.getValueNode());
8
        ArgumentsCallback argsCallback = getArgsCallback(opAsgnNode.getValueNode());
9
        
9
        
10
        context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback);
10
        context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback);
11
        // TODO: don't require pop
11
        // TODO: don't require pop
12
        if (!expr) context.consumeCurrentValue();
12
        if (!expr) context.consumeCurrentValue();
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.1
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    final OpAsgnNode opAsgnNode = (OpAsgnNode)node;
    1
    final OpAsgnNode opAsgnNode = (OpAsgnNode)node;
    2
    final CompilerCallback receiverCallback = new CompilerCallback() {...};
    2
    final CompilerCallback receiverCallback = new CompilerCallback() {...};
    3
    ArgumentsCallback argsCallback = getArgsCallback(opAsgnNode.getValueNode());
    3
    ArgumentsCallback argsCallback = getArgsCallback(opAsgnNode.getValueNode());
    4
    context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback);
    4
    context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback);
    4
    context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback);
    Differences
    Expression1Expression2Difference
    invokeOpAsgnWithAndinvokeOpAsgnWithOrMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) is a void method call, and thus it cannot be parameterized
    Expression context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) is a void method call, and thus it cannot be parameterized
    4
    context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback);
    5
    if (!expr)
    5
    if (!expr)
    6
    context.consumeCurrentValue();
    6
    context.consumeCurrentValue();
    Precondition Violations (4)
    Row Violation
    1Expression context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) is a void method call, and thus it cannot be parameterized
    4Expression context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) is a void method call, and thus it cannot be parameterized