if (anno.compat() == CompatVersion.RUBY1_8) { methodsHash = staticAnnotatedMethods1_8; } else if (anno.compat() == CompatVersion.RUBY1_9) { methodsHash = staticAnnotatedMethods1_9; } else { methodsHash = staticAnnotatedMethods; }
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/RubyModule.java
Method name: void visitClassDeclaration(ClassDeclaration) Method name: void clump(Class)
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 = staticAnnotatedMethods1_8;
2
                        methodsHash = staticAnnotatedMethods1_8;
3
                            } else if (anno.compat() == CompatVersion.RUBY1_9) {
3
                    } else if (anno.compat() == CompatVersion.RUBY1_9) {
4
                                methodsHash = staticAnnotatedMethods1_9;
4
                        methodsHash = staticAnnotatedMethods1_9;
5
                            } else {
5
                    } else {
6
                                methodsHash = staticAnnotatedMethods;
6
                        methodsHash = staticAnnotatedMethods;
7
                            }
7
                    }
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)1.0
Clones locationClones are in different classes
Number of node comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    48
    if (anno.compat() == CompatVersion.RUBY1_8)
    11
    if (anno.compat() == CompatVersion.RUBY1_8)
                                                                                        
    12
    methodsHash = staticAnnotatedMethods1_8;
    Preondition Violations
    Unmatched statement methodsHash=staticAnnotatedMethods1_8; cannot be moved, because it updates a variable modified in other unmapped statements
    12
    methodsHash = staticAnnotatedMethods1_8;
    49
    methodsHash = staticAnnotatedMethods1_8;
    49
    methodsHash = staticAnnotatedMethods1_8;
    Preondition Violations
    Unmatched statement methodsHash=staticAnnotatedMethods1_8; cannot be moved, because it updates a variable modified in other unmapped statements
                                                                                        
    50
    else if (anno.compat() == CompatVersion.RUBY1_9)
    13
    else if (anno.compat() == CompatVersion.RUBY1_9)
                                                                                        
    14
    methodsHash = staticAnnotatedMethods1_9;
    Preondition Violations
    Unmatched statement methodsHash=staticAnnotatedMethods1_9; cannot be moved, because it updates a variable modified in other unmapped statements
    14
    methodsHash = staticAnnotatedMethods1_9;
    51
    methodsHash = staticAnnotatedMethods1_9;
    51
    methodsHash = staticAnnotatedMethods1_9;
    Preondition Violations
    Unmatched statement methodsHash=staticAnnotatedMethods1_9; cannot be moved, because it updates a variable modified in other unmapped statements
                                                                                        
    else
            
                                                                                  
    15
    methodsHash = staticAnnotatedMethods;
    Preondition Violations
    Unmatched statement methodsHash=staticAnnotatedMethods; cannot be moved, because it updates a variable modified in other unmapped statements
    15
    methodsHash = staticAnnotatedMethods;
    52
    methodsHash = staticAnnotatedMethods;
    52
    methodsHash = staticAnnotatedMethods;
    Preondition Violations
    Unmatched statement methodsHash=staticAnnotatedMethods; cannot be moved, because it updates a variable modified in other unmapped statements
                                                                                  
    Precondition Violations (6)
    Row Violation
    1Unmatched statement methodsHash=staticAnnotatedMethods1_8; cannot be moved, because it updates a variable modified in other unmapped statements
    2Unmatched statement methodsHash=staticAnnotatedMethods1_9; cannot be moved, because it updates a variable modified in other unmapped statements
    3Unmatched statement methodsHash=staticAnnotatedMethods; cannot be moved, because it updates a variable modified in other unmapped statements
    4Unmatched statement methodsHash=staticAnnotatedMethods1_8; cannot be moved, because it updates a variable modified in other unmapped statements
    5Unmatched statement methodsHash=staticAnnotatedMethods1_9; cannot be moved, because it updates a variable modified in other unmapped statements
    6Unmatched statement methodsHash=staticAnnotatedMethods; cannot be moved, because it updates a variable modified in other unmapped statements