if ( (rhs == Short.TYPE) && (lhs == Integer.TYPE || lhs == Long.TYPE || lhs == Float.TYPE || lhs == Double.TYPE)) return true;
if ((rhs == Character.TYPE) && (lhs == Integer.TYPE || lhs == Long.TYPE || lhs == Float.TYPE || lhs == Double.TYPE)) return true;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/Types.java File path: /jEdit-4.2/src/bsh/Types.java
Method name: boolean isJavaAssignable(Class, Class) Method name: boolean isJavaAssignable(Class, Class)
Number of AST nodes: 2 Number of AST nodes: 2
1
if ( (rhs == Short.TYPE) && 
1
if ((rhs == Character.TYPE) && 
2
				(lhs == Integer.TYPE || lhs == Long.TYPE ||
2
				(lhs == Integer.TYPE || lhs == Long.TYPE ||
3
                lhs == Float.TYPE || lhs == Double.TYPE))
3
                lhs == Float.TYPE || lhs == Double.TYPE))
4
                    return true;
4
                    return true;
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.1
Clones locationClones are in the same method
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    if ((rhs == Short.TYPE) && (lhs == Integer.TYPE || lhs == Long.TYPE || lhs == Float.TYPE || lhs == Double.TYPE))
    8
    if ((rhs == Short.TYPE) && (lhs == Integer.TYPE || lhs == Long.TYPE || lhs == Float.TYPE || lhs == Double.TYPE))
    10
    if ((rhs == Character.TYPE) && (lhs == Integer.TYPE || lhs == Long.TYPE || lhs == Float.TYPE || lhs == Double.TYPE))
    Differences
    Expression1Expression2Difference
    java.lang.Shortjava.lang.CharacterVARIABLE_TYPE_MISMATCH
    java.lang.Classjava.lang.ClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Short of variable Short does not match with type java.lang.Character of variable Character
    • Make classes java.lang.Short and java.lang.Character extend a common superclass
    Type java.lang.Class<java.lang.Short> of variable Short.TYPE does not match with type java.lang.Class<java.lang.Character> of variable Character.TYPE
    • Make classes java.lang.Class and java.lang.Class extend a common superclass
    10
    if ((rhs == Character.TYPE) && (lhs == Integer.TYPE || lhs == Long.TYPE || lhs == Float.TYPE || lhs == Double.TYPE))
    9
    return true;
    9
    return true;
    11
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    11
    return true;
    Precondition Violations (4)
    Row Violation
    1Type java.lang.Short of variable Short does not match with type java.lang.Character of variable Character
    2Type java.lang.Class<java.lang.Short> of variable Short.TYPE does not match with type java.lang.Class<java.lang.Character> of variable Character.TYPE
    3Conditional return true;
    4Conditional return true;