for (int i = 0; i < parameterTypes.length; ++i) { if (!isFastIntParam(parameterTypes[i])) { return false; } } return parameterTypes.length <= 3 && isFastIntResult(returnType);
for (int i = 0; i < parameterTypes.length; ++i) { if (!isFastLongParam(parameterTypes[i])) { return false; } } return parameterTypes.length <= 3 && isFastLongResult(returnType);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/FastIntMethodFactory.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/FastLongMethodFactory.java
Method name: boolean isFastIntMethod(Type, Type[]) Method name: boolean isFastLongMethod(Type, Type[])
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i = 0; i < parameterTypes.length; ++i) {
1
for (int i = 0; i < parameterTypes.length; ++i) {
2
            if (!isFastIntParam(parameterTypes[i])) {
2
            if (!isFastLongParam(parameterTypes[i])) {
3
                return false;
3
                return false;
4
            }
4
            }
5
        }
5
        }
6
        return parameterTypes.length <= 3 && isFastIntResult(returnType);
6
        return parameterTypes.length <= 3 && isFastLongResult(returnType);
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.4
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < parameterTypes.length; ++i)
    1
    for (int i = 0; i < parameterTypes.length; ++i)
    2
    if (!isFastIntParam(parameterTypes[i]))
    2
    if (!isFastIntParam(parameterTypes[i]))
    2
    if (!isFastLongParam(parameterTypes[i]))
    Differences
    Expression1Expression2Difference
    isFastIntParamisFastLongParamMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression isFastIntParam(parameterTypes[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression isFastLongParam(parameterTypes[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    if (!isFastLongParam(parameterTypes[i]))
    3
    return false;
    3
    return false;
    4
    return parameterTypes.length <= 3 && isFastIntResult(returnType);
    4
    return parameterTypes.length <= 3 && isFastIntResult(returnType);
    4
    return parameterTypes.length <= 3 && isFastLongResult(returnType);
    Differences
    Expression1Expression2Difference
    isFastIntResultisFastLongResultMETHOD_INVOCATION_NAME_MISMATCH
    4
    return parameterTypes.length <= 3 && isFastLongResult(returnType);
    Precondition Violations (2)
    Row Violation
    1Expression isFastIntParam(parameterTypes[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression isFastLongParam(parameterTypes[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted