if(operand instanceof Float) return new Float(Primitive.floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Double(Primitive.doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError("An error occurred. Please call technical support.");
if(operand instanceof Float) return new Primitive(floatUnaryOperation((Float)operand, kind)); else if(operand instanceof Double) return new Primitive(doubleUnaryOperation((Double)operand, kind)); else throw new InterpreterError( "An error occurred. Please call technical support.");
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: 5 Number of AST nodes: 5
1
if(operand instanceof Float)
1
if(operand instanceof Float)
2
            return new Float(Primitive.floatUnaryOperation((Float)operand, kind));
2
            return new Primitive(floatUnaryOperation((Float)operand, kind));
3
        else if(operand instanceof Double)
3
        else if(operand instanceof Double)
4
            return new Double(Primitive.doubleUnaryOperation((Double)operand, kind));
4
            return new Primitive(doubleUnaryOperation((Double)operand, kind));
5
        else
5
        else
6
            throw new InterpreterError(
6
            throw new InterpreterError(
7
"An error occurred.  Please call technical support.");
7
				"An error occurred.  Please call technical support.");
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.3
Clones locationClones are in different classes
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    17
    else if (operand instanceof Float)
    21
    else if (operand instanceof Float)
    18
    return new Float(Primitive.floatUnaryOperation((Float)operand, kind));
    18
    return new Float(Primitive.floatUnaryOperation((Float)operand, kind));
    Preondition Violations
    Unmatched statement return new Float(Primitive.floatUnaryOperation((Float)operand,kind)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return new Float(Primitive.floatUnaryOperation((Float)operand,kind));
                                                                                                                                                      
                                                                                                                                          
    22
    return new Primitive(floatUnaryOperation((Float)operand, kind));
    Preondition Violations
    Unmatched statement return new Primitive(floatUnaryOperation((Float)operand,kind)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return new Primitive(floatUnaryOperation((Float)operand,kind));
    22
    return new Primitive(floatUnaryOperation((Float)operand, kind));
    19
    else if (operand instanceof Double)
    23
    else if (operand instanceof Double)
    20
    return new Double(Primitive.doubleUnaryOperation((Double)operand, kind));
    20
    return new Double(Primitive.doubleUnaryOperation((Double)operand, kind));
    Preondition Violations
    Unmatched statement return new Double(Primitive.doubleUnaryOperation((Double)operand,kind)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return new Double(Primitive.doubleUnaryOperation((Double)operand,kind));
                                                                                                                                                            
                                                                                                                                              
    24
    return new Primitive(doubleUnaryOperation((Double)operand, kind));
    Preondition Violations
    Unmatched statement return new Primitive(doubleUnaryOperation((Double)operand,kind)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return new Primitive(doubleUnaryOperation((Double)operand,kind));
    24
    return new Primitive(doubleUnaryOperation((Double)operand, kind));
    else
    else
    21
    throw new InterpreterError("An error occurred.  Please call technical support.");
    25
    throw new InterpreterError("An error occurred.  Please call technical support.");
    Precondition Violations (8)
    Row Violation
    1Unmatched statement return new Float(Primitive.floatUnaryOperation((Float)operand,kind)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched return new Float(Primitive.floatUnaryOperation((Float)operand,kind));
    3Unmatched statement return new Primitive(floatUnaryOperation((Float)operand,kind)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return new Primitive(floatUnaryOperation((Float)operand,kind));
    5Unmatched statement return new Double(Primitive.doubleUnaryOperation((Double)operand,kind)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched return new Double(Primitive.doubleUnaryOperation((Double)operand,kind));
    7Unmatched statement return new Primitive(doubleUnaryOperation((Double)operand,kind)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Unmatched return new Primitive(doubleUnaryOperation((Double)operand,kind));