if ( kind == BOOL_OR || kind == BOOL_ORX ) { Object obj = lhs; if ( isPrimitiveValue(lhs) ) obj = ((Primitive)lhs).getValue(); if ( obj instanceof Boolean && ( ((Boolean)obj).booleanValue() == true ) ) return new Primitive(true); }
if ( kind == BOOL_AND || kind == BOOL_ANDX ) { Object obj = lhs; if ( isPrimitiveValue(lhs) ) obj = ((Primitive)lhs).getValue(); if ( obj instanceof Boolean && ( ((Boolean)obj).booleanValue() == false ) ) return new Primitive(false); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/BSHBinaryExpression.java File path: /jEdit-4.2/src/bsh/BSHBinaryExpression.java
Method name: Object eval(CallStack, Interpreter) Method name: Object eval(CallStack, Interpreter)
Number of AST nodes: 6 Number of AST nodes: 6
1
if ( kind == BOOL_OR || kind == BOOL_ORX ) {
1
if ( kind == BOOL_AND || kind == BOOL_ANDX ) {
2
			Object obj = lhs;
2
			Object obj = lhs;
3
			if ( isPrimitiveValue(lhs) )
3
			if ( isPrimitiveValue(lhs) )
4
				obj = ((Primitive)lhs).getValue();
4
				obj = ((Primitive)lhs).getValue();
5
			if ( obj instanceof Boolean && 
5
			if ( obj instanceof Boolean && 
6
				( ((Boolean)obj).booleanValue() == true ) )
6
				( ((Boolean)obj).booleanValue() == false ) )
7
				return new Primitive(true);
7
				return new Primitive(false);
8
		}
8
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.8
Clones locationClones are in the same method
Number of node comparisons17
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    18
    if (kind == BOOL_OR || kind == BOOL_ORX)
    18
    if (kind == BOOL_OR || kind == BOOL_ORX)
    12
    if (kind == BOOL_AND || kind == BOOL_ANDX)
    Differences
    Expression1Expression2Difference
    BOOL_ORBOOL_ANDVARIABLE_NAME_MISMATCH
    BOOL_ORXBOOL_ANDXVARIABLE_NAME_MISMATCH
    12
    if (kind == BOOL_AND || kind == BOOL_ANDX)
    19
    Object obj = lhs;
    13
    Object obj = lhs;
    20
    if (isPrimitiveValue(lhs))
    14
    if (isPrimitiveValue(lhs))
    21
    obj = ((Primitive)lhs).getValue();
    15
    obj = ((Primitive)lhs).getValue();
    22
    if (obj instanceof Boolean && (((Boolean)obj).booleanValue() == true))
    22
    if (obj instanceof Boolean && (((Boolean)obj).booleanValue() == true))
    16
    if (obj instanceof Boolean && (((Boolean)obj).booleanValue() == false))
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    16
    if (obj instanceof Boolean && (((Boolean)obj).booleanValue() == false))
    23
    return new Primitive(true);
    23
    return new Primitive(true);
    17
    return new Primitive(false);
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    17
    return new Primitive(false);
    Precondition Violations (0)
    Row Violation