final String sym = symbolName.toString(); final long address = library.getSymbolAddress(sym); if (address == 0L) { return context.getRuntime().getNil(); } return new Symbol(context.getRuntime(), this, sym, address != 0 ? new DataSymbolMemoryIO(context.getRuntime(), this, address) : new NullMemoryIO(context.getRuntime()));
final String sym = symbolName.toString(); final long address = library.getSymbolAddress(sym); if (address == 0L) { return context.getRuntime().getNil(); } return new Symbol(context.getRuntime(), this, sym, new TextSymbolMemoryIO(context.getRuntime(), this, address));
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/DynamicLibrary.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/DynamicLibrary.java
Method name: IRubyObject findVariable(ThreadContext, IRubyObject) Method name: IRubyObject findFunction(ThreadContext, IRubyObject)
Number of AST nodes: 5 Number of AST nodes: 5
1
final String sym = symbolName.toString();
1
final String sym = symbolName.toString();
2
        final long address = library.getSymbolAddress(sym);
2
        final long address = library.getSymbolAddress(sym);
3
        if (address == 0L) {
3
        if (address == 0L) {
4
            return context.getRuntime().getNil();
4
            return context.getRuntime().getNil();
5
        }
5
        }
6
        return new Symbol(context.getRuntime(), this, sym,
6
        return new Symbol(context.getRuntime(), this, sym,
7
                address != 0
7
 
8
                ? new DataSymbolMemoryIO(context.getRuntime(), this, address)
8
                new TextSymbolMemoryIO(context.getRuntime(), this, address)
9
                : new NullMemoryIO(context.getRuntime()));
9
);
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.1
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    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 1
    Mapped Statements
    ID Statement ID Statement
    1
    final String sym = symbolName.toString();
    1
    final String sym = symbolName.toString();
    2
    final long address = library.getSymbolAddress(sym);
    2
    final long address = library.getSymbolAddress(sym);
    3
    if (address == 0L)
    3
    if (address == 0L)
    4
    return context.getRuntime().getNil();
    4
    return context.getRuntime().getNil();
    5
    return new Symbol(context.getRuntime(), this, sym, address != 0 ? new DataSymbolMemoryIO(context.getRuntime(), this, address) : new NullMemoryIO(context.getRuntime()));
    5
    return new Symbol(context.getRuntime(), this, sym, new TextSymbolMemoryIO(context.getRuntime(), this, address));
    Precondition Violations (0)
    Row Violation