BackRefNode iVisited = (BackRefNode) node; context.performBackref(iVisited.getType()); // TODO: don't require pop if (!expr) context.consumeCurrentValue();
ClassVarNode classVarNode = (ClassVarNode) node; context.retrieveClassVariable(classVarNode.getName()); 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 compileBackref(Node, BodyCompiler, boolean) Method name: void compileClassVar(Node, BodyCompiler, boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
BackRefNode iVisited = (BackRefNode) node;
2
        context.performBackref(iVisited
1
ClassVarNode classVarNode = (ClassVarNode) node;
3
.getType());
2
        context.retrieveClassVariable(classVarNode.getName());
4
        // TODO: don't require pop
5
        if (!expr) context.consumeCurrentValue();
3
        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 comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    BackRefNode iVisited = (BackRefNode)node;
    1
    BackRefNode iVisited = (BackRefNode)node;
    1
    ClassVarNode classVarNode = (ClassVarNode)node;
    Differences
    Expression1Expression2Difference
    org.jruby.ast.BackRefNodeorg.jruby.ast.ClassVarNodeSUBCLASS_TYPE_MISMATCH
    iVisitedclassVarNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.BackRefNodeorg.jruby.ast.ClassVarNodeSUBCLASS_TYPE_MISMATCH
    org.jruby.ast.BackRefNodeorg.jruby.ast.ClassVarNodeSUBCLASS_TYPE_MISMATCH
    1
    ClassVarNode classVarNode = (ClassVarNode)node;
                                                                                                                      
    2
    context.retrieveClassVariable(classVarNode.getName());
    2
    context.performBackref(iVisited.getType());
                                                                                                
    3
    if (!expr)
    3
    if (!expr)
    4
    context.consumeCurrentValue();
    4
    context.consumeCurrentValue();
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variable iVisited with type org.jruby.ast.BackRefNode , while Clone fragment #2 returns variable classVarNode with type org.jruby.ast.ClassVarNode