try { if (isModuleAndHasConstant(leftNode.interpret(runtime, context, self, aBlock))) return "constant"; } catch (JumpException e) {} return null;
try { if (hasMethod(leftNode.interpret(runtime, context, self, aBlock))) return "method"; } catch (JumpException e) { } return null;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ast/Colon2ConstNode.java File path: /jruby-1.4.0/src/org/jruby/ast/Colon2MethodNode.java
Method name: String definition(Ruby, ThreadContext, IRubyObject, Block) Method name: String definition(Ruby, ThreadContext, IRubyObject, Block)
Number of AST nodes: 4 Number of AST nodes: 4
1
try {
1
try {
2
            if (isModuleAndHasConstant(leftNode.interpret(runtime, context, self, aBlock))) return "constant";
2
           if (hasMethod(leftNode.interpret(runtime, context, self, aBlock))) return "method";
3
        } catch (JumpException e) {
3
        } catch (JumpException e) {
4
}
4
        }
5
        return null;
5
        return null;
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons6
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    2
    if (isModuleAndHasConstant(leftNode.interpret(runtime, context, self, aBlock)))
    2
    if (isModuleAndHasConstant(leftNode.interpret(runtime, context, self, aBlock)))
    2
    if (hasMethod(leftNode.interpret(runtime, context, self, aBlock)))
    Differences
    Expression1Expression2Difference
    isModuleAndHasConstanthasMethodMETHOD_INVOCATION_NAME_MISMATCH
    2
    if (hasMethod(leftNode.interpret(runtime, context, self, aBlock)))
    3
    return "constant";
    3
    return "constant";
    3
    return "method";
    Differences
    Expression1Expression2Difference
    "constant""method"LITERAL_VALUE_MISMATCH
    3
    return "method";
    4
    return null;
    4
    return null;
    Precondition Violations (0)
    Row Violation