final AliasNode alias = (AliasNode) node; context.defineAlias(alias.getNewName(), alias.getOldName()); // TODO: don't require pop if (!expr) context.consumeCurrentValue();
VAliasNode valiasNode = (VAliasNode) node; context.aliasGlobal(valiasNode.getNewName(), valiasNode.getOldName()); // 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 compileAlias(Node, BodyCompiler, boolean) Method name: void compileVAlias(Node, BodyCompiler, boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
final AliasNode alias = (AliasNode) node;
1
VAliasNode valiasNode = (VAliasNode) node;
2
        context.defineAlias(alias.getNewName(), alias.getOldName());
2
        context.aliasGlobal(valiasNode.getNewName(), valiasNode.getOldName());
3
        // TODO: don't require pop
3
        // TODO: don't require pop
4
        if (!expr) context.consumeCurrentValue();
4
        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)4.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                        
    1
    VAliasNode valiasNode = (VAliasNode)node;
    1
    final AliasNode alias = (AliasNode)node;
                                                                                      
    2
    context.defineAlias(alias.getNewName(), alias.getOldName());
    2
    context.defineAlias(alias.getNewName(), alias.getOldName());
    2
    context.aliasGlobal(valiasNode.getNewName(), valiasNode.getOldName());
    Differences
    Expression1Expression2Difference
    defineAliasaliasGlobalMETHOD_INVOCATION_NAME_MISMATCH
    aliasvaliasNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.AliasNodeorg.jruby.ast.VAliasNodeSUBCLASS_TYPE_MISMATCH
    aliasvaliasNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.AliasNodeorg.jruby.ast.VAliasNodeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression context.defineAlias(alias.getNewName(),alias.getOldName()) is a void method call, and thus it cannot be parameterized
    Expression context.aliasGlobal(valiasNode.getNewName(),valiasNode.getOldName()) is a void method call, and thus it cannot be parameterized
    Expression alias cannot be unified with expression valiasNode , because common superclass org.jruby.ast.Node does not declare member(s) public java.lang.String getNewName() , public java.lang.String getOldName()
    Expression alias cannot be unified with expression valiasNode , because common superclass org.jruby.ast.Node does not declare member(s) public java.lang.String getNewName() , public java.lang.String getOldName()
    2
    context.aliasGlobal(valiasNode.getNewName(), valiasNode.getOldName());
    3
    if (!expr)
    3
    if (!expr)
    4
    context.consumeCurrentValue();
    4
    context.consumeCurrentValue();
    Precondition Violations (4)
    Row Violation
    1Expression context.defineAlias(alias.getNewName(),alias.getOldName()) is a void method call, and thus it cannot be parameterized
    2Expression context.aliasGlobal(valiasNode.getNewName(),valiasNode.getOldName()) is a void method call, and thus it cannot be parameterized
    3Expression alias cannot be unified with expression valiasNode , because common superclass org.jruby.ast.Node does not declare member(s) public java.lang.String getNewName() , public java.lang.String getOldName()
    4Expression alias cannot be unified with expression valiasNode , because common superclass org.jruby.ast.Node does not declare member(s) public java.lang.String getNewName() , public java.lang.String getOldName()