if (anno.compat() == CompatVersion.RUBY1_8) { methodsHash = annotatedMethods1_8; } else if (anno.compat() == CompatVersion.RUBY1_9) { methodsHash = annotatedMethods1_9; } else { methodsHash = annotatedMethods; }
if (anno.compat() == CompatVersion.RUBY1_8) { methodsHash = staticAnnotatedMethods1_8; } else if (anno.compat() == CompatVersion.RUBY1_9) { methodsHash = staticAnnotatedMethods1_9; } else { methodsHash = staticAnnotatedMethods; }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/anno/AnnotationBinder.java File path: /jruby-1.4.0/src/org/jruby/anno/AnnotationBinder.java
Method name: void visitClassDeclaration(ClassDeclaration) Method name: void visitClassDeclaration(ClassDeclaration)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (anno.compat() == CompatVersion.RUBY1_8) {
1
if (anno.compat() == CompatVersion.RUBY1_8) {
2
                                methodsHash = annotatedMethods1_8;
2
                                methodsHash = staticAnnotatedMethods1_8;
3
                            } else if (anno.compat() == CompatVersion.RUBY1_9) {
3
                            } else if (anno.compat() == CompatVersion.RUBY1_9) {
4
                                methodsHash = annotatedMethods1_9;
4
                                methodsHash = staticAnnotatedMethods1_9;
5
                            } else {
5
                            } else {
6
                                methodsHash = annotatedMethods;
6
                                methodsHash = staticAnnotatedMethods;
7
                            }
7
                            }
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.8
Clones locationClones are in the same method
Number of node comparisons21
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    53
    if (anno.compat() == CompatVersion.RUBY1_8)
    48
    if (anno.compat() == CompatVersion.RUBY1_8)
    54
    methodsHash = annotatedMethods1_8;
    54
    methodsHash = annotatedMethods1_8;
    49
    methodsHash = staticAnnotatedMethods1_8;
    Differences
    Expression1Expression2Difference
    annotatedMethods1_8staticAnnotatedMethods1_8VARIABLE_NAME_MISMATCH
    49
    methodsHash = staticAnnotatedMethods1_8;
    55
    else if (anno.compat() == CompatVersion.RUBY1_9)
    50
    else if (anno.compat() == CompatVersion.RUBY1_9)
    56
    methodsHash = annotatedMethods1_9;
    56
    methodsHash = annotatedMethods1_9;
    51
    methodsHash = staticAnnotatedMethods1_9;
    Differences
    Expression1Expression2Difference
    annotatedMethods1_9staticAnnotatedMethods1_9VARIABLE_NAME_MISMATCH
    51
    methodsHash = staticAnnotatedMethods1_9;
    else
    else
    57
    methodsHash = annotatedMethods;
    57
    methodsHash = annotatedMethods;
    52
    methodsHash = staticAnnotatedMethods;
    Differences
    Expression1Expression2Difference
    annotatedMethodsstaticAnnotatedMethodsVARIABLE_NAME_MISMATCH
    52
    methodsHash = staticAnnotatedMethods;
    Precondition Violations (0)
    Row Violation