if(profile.allowBuiltin(name)) { loadService.addBuiltinLibrary(name,lib); }
for (int i = 0; i < throwables.length; i++) { if (checkJavaException(currentThrowable, throwables[0])) { return context.getRuntime().getTrue(); } }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/Ruby.java File path: /jruby-1.4.0/src/org/jruby/javasupport/util/RuntimeHelpers.java
Method name: void addBuiltinIfAllowed(String, Library) Method name: IRubyObject isJavaExceptionHandled(Throwable, IRubyObject[], ThreadContext)
Number of AST nodes: 2 Number of AST nodes: 3
1
if(profile.allowBuil
1
for (int i = 0; i < throwables.length; i++) {
2
tin(name)) {
2
                if (checkJavaException(
3
            loadService.addBuiltinLibrary(name,lib);
3
currentThrowable, throwables[0])) {
4
                    return context.getRuntime().getTrue();
5
                }
4
        }
6
            }
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.1
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (profile.allowBuiltin(name))
    1
    if (profile.allowBuiltin(name))
    4
    if (checkJavaException(currentThrowable, throwables[0]))
    Differences
    Expression1Expression2Difference
    allowBuiltincheckJavaExceptionMETHOD_INVOCATION_NAME_MISMATCH
    profile.allowBuiltin(name)checkJavaException(currentThrowable,throwables[0])ARGUMENT_NUMBER_MISMATCH
    profileMISSING_METHOD_INVOCATION_EXPRESSION
    4
    if (checkJavaException(currentThrowable, throwables[0]))
    2
    loadService.addBuiltinLibrary(name, lib);
                                                                                          
                                                                                      
    5
    return context.getRuntime().getTrue();
    Preondition Violations
    Unmatched return context.getRuntime().getTrue();
    5
    return context.getRuntime().getTrue();
    Precondition Violations (1)
    Row Violation
    1Unmatched return context.getRuntime().getTrue();