case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Double(lhs + rhs); case MINUS: return new Double(lhs - rhs); case STAR: return new Double(lhs * rhs); case SLASH: return new Double(lhs / rhs); case MOD: return new Double(lhs % rhs); // can't shift floating-point values case LSHIFT: case LSHIFTX:
case LT: case LTX: return new Boolean(lhs < rhs); case GT: case GTX: return new Boolean(lhs > rhs); case EQ: return new Boolean(lhs == rhs); case LE: case LEX: return new Boolean(lhs <= rhs); case GE: case GEX: return new Boolean(lhs >= rhs); case NE: return new Boolean(lhs != rhs); // arithmetic case PLUS: return new Integer(lhs + rhs); case MINUS: return new Integer(lhs - rhs); case STAR: return new Integer(lhs * rhs); case SLASH: return new Integer(lhs / rhs); case MOD: return new Integer(lhs % rhs); // bitwise case LSHIFT: case LSHIFTX:
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/Primitive.java File path: /jEdit-4.2/src/bsh/Primitive.java
Method name: Object doubleBinaryOperation(Double, Double, int) Method name: Object intBinaryOperation(Integer, Integer, int)
Number of AST nodes: 28 Number of AST nodes: 28
1
case LT:
1
case LT:
2
            case LTX:
2
            case LTX:
3
                return new Boolean(lhs < rhs);
3
                return new Boolean(lhs < rhs);
4
            case GT:
4
            case GT:
5
            case GTX:
5
            case GTX:
6
                return new Boolean(lhs > rhs);
6
                return new Boolean(lhs > rhs);
7
            case EQ:
7
            case EQ:
8
                return new Boolean(lhs == rhs);
8
                return new Boolean(lhs == rhs);
9
            case LE:
9
            case LE:
10
            case LEX:
10
            case LEX:
11
                return new Boolean(lhs <= rhs);
11
                return new Boolean(lhs <= rhs);
12
            case GE:
12
            case GE:
13
            case GEX:
13
            case GEX:
14
                return new Boolean(lhs >= rhs);
14
                return new Boolean(lhs >= rhs);
15
            case NE:
15
            case NE:
16
                return new Boolean(lhs != rhs);
16
                return new Boolean(lhs != rhs);
17
            // arithmetic
17
            // arithmetic
18
            case PLUS:
18
            case PLUS:
19
                return new Double(lhs + rhs);
19
                return new Integer(lhs + rhs);
20
            case MINUS:
20
            case MINUS:
21
                return new Double(lhs - rhs);
21
                return new Integer(lhs - rhs);
22
            case STAR:
22
            case STAR:
23
                return new Double(lhs * rhs);
23
                return new Integer(lhs * rhs);
24
            case SLASH:
24
            case SLASH:
25
                return new Double(lhs / rhs);
25
                return new Integer(lhs / rhs);
26
            case MOD:
26
            case MOD:
27
                return new Double(lhs % rhs);
27
                return new Integer(lhs % rhs);
28
            // can't shift floating-point values
28
            // bitwise
29
            case LSHIFT:
29
            case LSHIFT:
30
            case LSHIFTX:
30
            case LSHIFTX:
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.0
Clones locationClones are declared in the same class
Number of node comparisons472
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment11
    Number of unmapped statements in the second code fragment11
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    case LT:
    4
    case LT:
    5
    case LTX:
    5
    case LTX:
                                                                      
    6
    return new Boolean(lhs < rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs < rhs);
    6
    return new Boolean(lhs < rhs);
    6
    return new Boolean(lhs < rhs);
    6
    return new Boolean(lhs < rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs < rhs);
                                                                      
    7
    case GT:
    7
    case GT:
    8
    case GTX:
    8
    case GTX:
                                                                      
    9
    return new Boolean(lhs > rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs > rhs);
    9
    return new Boolean(lhs > rhs);
    9
    return new Boolean(lhs > rhs);
    9
    return new Boolean(lhs > rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs > rhs);
                                                                      
    10
    case EQ:
    10
    case EQ:
                                                                          
    11
    return new Boolean(lhs == rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs == rhs);
    11
    return new Boolean(lhs == rhs);
    11
    return new Boolean(lhs == rhs);
    11
    return new Boolean(lhs == rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs == rhs);
                                                                          
    12
    case LE:
    12
    case LE:
    13
    case LEX:
    13
    case LEX:
                                                                          
    14
    return new Boolean(lhs <= rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs <= rhs);
    14
    return new Boolean(lhs <= rhs);
    14
    return new Boolean(lhs <= rhs);
    14
    return new Boolean(lhs <= rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs <= rhs);
                                                                          
    15
    case GE:
    15
    case GE:
    16
    case GEX:
    16
    case GEX:
                                                                          
    17
    return new Boolean(lhs >= rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs >= rhs);
    17
    return new Boolean(lhs >= rhs);
    17
    return new Boolean(lhs >= rhs);
    17
    return new Boolean(lhs >= rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs >= rhs);
                                                                          
    18
    case NE:
    18
    case NE:
                                                                          
    19
    return new Boolean(lhs != rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs != rhs);
    19
    return new Boolean(lhs != rhs);
    19
    return new Boolean(lhs != rhs);
    19
    return new Boolean(lhs != rhs);
    Preondition Violations
    Unmatched return new Boolean(lhs != rhs);
                                                                          
    20
    case PLUS:
    20
    case PLUS:
                                                                        
    21
    return new Integer(lhs + rhs);
    Preondition Violations
    Unmatched return new Integer(lhs + rhs);
    21
    return new Integer(lhs + rhs);
    21
    return new Double(lhs + rhs);
    21
    return new Double(lhs + rhs);
    Preondition Violations
    Unmatched return new Double(lhs + rhs);
                                                                      
    22
    case MINUS:
    22
    case MINUS:
                                                                        
    23
    return new Integer(lhs - rhs);
    Preondition Violations
    Unmatched return new Integer(lhs - rhs);
    23
    return new Integer(lhs - rhs);
    23
    return new Double(lhs - rhs);
    23
    return new Double(lhs - rhs);
    Preondition Violations
    Unmatched return new Double(lhs - rhs);
                                                                      
    24
    case STAR:
    24
    case STAR:
                                                                        
    25
    return new Integer(lhs * rhs);
    Preondition Violations
    Unmatched return new Integer(lhs * rhs);
    25
    return new Integer(lhs * rhs);
    25
    return new Double(lhs * rhs);
    25
    return new Double(lhs * rhs);
    Preondition Violations
    Unmatched return new Double(lhs * rhs);
                                                                      
    26
    case SLASH:
    26
    case SLASH:
                                                                        
    27
    return new Integer(lhs / rhs);
    Preondition Violations
    Unmatched return new Integer(lhs / rhs);
    27
    return new Integer(lhs / rhs);
    27
    return new Double(lhs / rhs);
    27
    return new Double(lhs / rhs);
    Preondition Violations
    Unmatched return new Double(lhs / rhs);
                                                                      
    28
    case MOD:
    28
    case MOD:
                                                                        
    29
    return new Integer(lhs % rhs);
    Preondition Violations
    Unmatched return new Integer(lhs % rhs);
    29
    return new Integer(lhs % rhs);
    29
    return new Double(lhs % rhs);
    29
    return new Double(lhs % rhs);
    Preondition Violations
    Unmatched return new Double(lhs % rhs);
                                                                      
    30
    case LSHIFT:
    30
    case LSHIFT:
    31
    case LSHIFTX:
    31
    case LSHIFTX:
    Precondition Violations (22)
    Row Violation
    1Unmatched return new Boolean(lhs < rhs);
    2Unmatched return new Boolean(lhs < rhs);
    3Unmatched return new Boolean(lhs > rhs);
    4Unmatched return new Boolean(lhs > rhs);
    5Unmatched return new Boolean(lhs == rhs);
    6Unmatched return new Boolean(lhs == rhs);
    7Unmatched return new Boolean(lhs <= rhs);
    8Unmatched return new Boolean(lhs <= rhs);
    9Unmatched return new Boolean(lhs >= rhs);
    10Unmatched return new Boolean(lhs >= rhs);
    11Unmatched return new Boolean(lhs != rhs);
    12Unmatched return new Boolean(lhs != rhs);
    13Unmatched return new Integer(lhs + rhs);
    14Unmatched return new Double(lhs + rhs);
    15Unmatched return new Integer(lhs - rhs);
    16Unmatched return new Double(lhs - rhs);
    17Unmatched return new Integer(lhs * rhs);
    18Unmatched return new Double(lhs * rhs);
    19Unmatched return new Integer(lhs / rhs);
    20Unmatched return new Double(lhs / rhs);
    21Unmatched return new Integer(lhs % rhs);
    22Unmatched return new Double(lhs % rhs);