if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Byte((byte)result); if(operandType == Short.TYPE) return new Short((short)result); if(operandType == Character.TYPE) return new Character((char)result); }
if(kind == INCR || kind == DECR) { if(operandType == Byte.TYPE) return new Primitive((byte)result); if(operandType == Short.TYPE) return new Primitive((short)result); if(operandType == Character.TYPE) return new Primitive((char)result); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/BSHUnaryExpression.java File path: /jEdit-4.2/src/bsh/Primitive.java
Method name: Object primitiveWrapperUnaryOperation(Object, int) Method name: Primitive unaryOperation(Primitive, int)
Number of AST nodes: 7 Number of AST nodes: 7
1
if(kind == INCR || kind == DECR)
1
if(kind == INCR || kind == DECR)
2
            {
2
            {
3
                if(operandType == Byte.TYPE)
3
                if(operandType == Byte.TYPE)
4
                    return new Byte((byte)result);
4
                    return new Primitive((byte)result);
5
                if(operandType == Short.TYPE)
5
                if(operandType == Short.TYPE)
6
                    return new Short((short)result);
6
                    return new Primitive((short)result);
7
                if(operandType == Character.TYPE)
7
                if(operandType == Character.TYPE)
8
                    return new Character((char)result);
8
                    return new Primitive((char)result);
9
            }
9
            }
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.3
Clones locationClones are in different classes
Number of node comparisons29
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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
    7
    if (kind == INCR || kind == DECR)
    11
    if (kind == INCR || kind == DECR)
    8
    if (operandType == Byte.TYPE)
    12
    if (operandType == Byte.TYPE)
    9
    return new Byte((byte)result);
    9
    return new Byte((byte)result);
    Preondition Violations
    Unmatched return new Byte((byte)result);
                                                                      
                                                                                  
    13
    return new Primitive((byte)result);
    Preondition Violations
    Unmatched return new Primitive((byte)result);
    13
    return new Primitive((byte)result);
    10
    if (operandType == Short.TYPE)
    14
    if (operandType == Short.TYPE)
    11
    return new Short((short)result);
    11
    return new Short((short)result);
    Preondition Violations
    Unmatched return new Short((short)result);
                                                                            
                                                                                    
    15
    return new Primitive((short)result);
    Preondition Violations
    Unmatched return new Primitive((short)result);
    15
    return new Primitive((short)result);
    12
    if (operandType == Character.TYPE)
    16
    if (operandType == Character.TYPE)
    13
    return new Character((char)result);
    13
    return new Character((char)result);
    Preondition Violations
    Unmatched return new Character((char)result);
                                                                                  
                                                                                  
    17
    return new Primitive((char)result);
    Preondition Violations
    Unmatched return new Primitive((char)result);
    17
    return new Primitive((char)result);
    Precondition Violations (6)
    Row Violation
    1Unmatched return new Byte((byte)result);
    2Unmatched return new Primitive((byte)result);
    3Unmatched return new Short((short)result);
    4Unmatched return new Primitive((short)result);
    5Unmatched return new Character((char)result);
    6Unmatched return new Primitive((char)result);