if ( type instanceof BSHAmbiguousName ) { BSHAmbiguousName name = (BSHAmbiguousName)type; if (args instanceof BSHArguments) return objectAllocation(name, (BSHArguments)args, callstack, interpreter ); else return objectArrayAllocation(name, (BSHArrayDimensions)args, callstack, interpreter ); } else return primitiveArrayAllocation((BSHPrimitiveType)type, (BSHArrayDimensions)args, callstack, interpreter );
if(lhs instanceof Long) return longBinaryOperation((Long)lhs, (Long)rhs, kind); else if(lhs instanceof Float) return floatBinaryOperation((Float)lhs, (Float)rhs, kind); else if(lhs instanceof Double) return doubleBinaryOperation( (Double)lhs, (Double)rhs, kind); else throw new UtilEvalError("Invalid types in binary operator" );
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/BSHAllocationExpression.java File path: /jEdit-4.2/src/bsh/Primitive.java
Method name: Object eval(CallStack, Interpreter) Method name: Object binaryOperationImpl(Object, Object, int)
Number of AST nodes: 6 Number of AST nodes: 7
1
if ( type instanceof BSHAmbiguousName )
1
if(lhs instanceof Long)
2
        {
2
        
3
            BSHAmbiguousName name = (BSHAmbiguousName)type;
3
    
4
  
4
return longBinaryOperation((Long)lhs, (Long)rhs, kind);
5
          if (args instanceof BSHArguments)
5
        else if(lhs instanceof 
6
    
6
Float)
7
            return objectAllocation(name, (BSHArguments)args, 
7
            return 
8
					callstack, interpreter );
9
   
8
floatBinaryOperation((Float)lhs, (Float)rhs, kind);
10
         else
9
        else
11
                return objectArrayAllocation(name, (BSHArrayDimensions)args, 
12
					callstack, interpreter );
13
        }
14
        else
15
            return primitiveArrayAllocation((BSHPrimitiveType)type,
16
                (BSHArrayDimensions)args, callstack, interpreter
10
 if(lhs instanceof Double)
11
            return doubleBinaryOperation( (Double)lhs, (Double)rhs, kind);
12
        else
17
 );
13
            throw new UtilEvalError("Invalid types in binary operator" );
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons3