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 Float(lhs + rhs); case MINUS: return new Float(lhs - rhs); case STAR: return new Float(lhs * rhs); case SLASH: return new Float(lhs / rhs); case MOD: return new Float(lhs % rhs); // can't shift floats 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 Long(lhs + rhs); case MINUS: return new Long(lhs - rhs); case STAR: return new Long(lhs * rhs); case SLASH: return new Long(lhs / rhs); case MOD: return new Long(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 floatBinaryOperation(Float, Float, int) Method name: Object longBinaryOperation(Long, Long, 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 Float(lhs + rhs);
19
                return new Long(lhs + rhs);
20
            case MINUS:
20
            case MINUS:
21
                return new Float(lhs - rhs);
21
                return new Long(lhs - rhs);
22
            case STAR:
22
            case STAR:
23
                return new Float(lhs * rhs);
23
                return new Long(lhs * rhs);
24
            case SLASH:
24
            case SLASH:
25
                return new Float(lhs / rhs);
25
                return new Long(lhs / rhs);
26
            case MOD:
26
            case MOD:
27
                return new Float(lhs % rhs);
27
                return new Long(lhs % rhs);
28
            // can't shift floats
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 Long(lhs + rhs);
    Preondition Violations
    Unmatched return new Long(lhs + rhs);
    21
    return new Long(lhs + rhs);
    21
    return new Float(lhs + rhs);
    21
    return new Float(lhs + rhs);
    Preondition Violations
    Unmatched return new Float(lhs + rhs);
                                                                    
    22
    case MINUS:
    22
    case MINUS:
                                                                  
    23
    return new Long(lhs - rhs);
    Preondition Violations
    Unmatched return new Long(lhs - rhs);
    23
    return new Long(lhs - rhs);
    23
    return new Float(lhs - rhs);
    23
    return new Float(lhs - rhs);
    Preondition Violations
    Unmatched return new Float(lhs - rhs);
                                                                    
    24
    case STAR:
    24
    case STAR:
                                                                  
    25
    return new Long(lhs * rhs);
    Preondition Violations
    Unmatched return new Long(lhs * rhs);
    25
    return new Long(lhs * rhs);
    25
    return new Float(lhs * rhs);
    25
    return new Float(lhs * rhs);
    Preondition Violations
    Unmatched return new Float(lhs * rhs);
                                                                    
    26
    case SLASH:
    26
    case SLASH:
                                                                  
    27
    return new Long(lhs / rhs);
    Preondition Violations
    Unmatched return new Long(lhs / rhs);
    27
    return new Long(lhs / rhs);
    27
    return new Float(lhs / rhs);
    27
    return new Float(lhs / rhs);
    Preondition Violations
    Unmatched return new Float(lhs / rhs);
                                                                    
    28
    case MOD:
    28
    case MOD:
                                                                  
    29
    return new Long(lhs % rhs);
    Preondition Violations
    Unmatched return new Long(lhs % rhs);
    29
    return new Long(lhs % rhs);
    29
    return new Float(lhs % rhs);
    29
    return new Float(lhs % rhs);
    Preondition Violations
    Unmatched return new Float(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 Long(lhs + rhs);
    14Unmatched return new Float(lhs + rhs);
    15Unmatched return new Long(lhs - rhs);
    16Unmatched return new Float(lhs - rhs);
    17Unmatched return new Long(lhs * rhs);
    18Unmatched return new Float(lhs * rhs);
    19Unmatched return new Long(lhs / rhs);
    20Unmatched return new Float(lhs / rhs);
    21Unmatched return new Long(lhs % rhs);
    22Unmatched return new Float(lhs % rhs);