RubyModule module; if ((module = javaUtilitiesModule) != null) return module; return javaUtilitiesModule = runtime.fastGetModule("JavaUtilities");
RubySymbol sym; if ((sym = symbol) != null) return sym; return symbol = runtime.fastNewSymbol(name);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaSupport.java File path: /jruby-1.4.0/src/org/jruby/ast/SymbolNode.java
Method name: RubyModule getJavaUtilitiesModule() Method name: RubySymbol getSymbol(Ruby)
Number of AST nodes: 4 Number of AST nodes: 4
1
RubyModule module;
1
RubySymbol sym;
2
        if ((module = javaUtilitiesModule) != null) return module;
2
        if ((sym = symbol) != null) return sym;
3
        return javaUtilitiesModule = runtime.fastGetModule("JavaUtilities");
3
        return symbol = runtime.fastNewSymbol(name);
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.2
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)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    RubyModule module;
    1
    RubyModule module;
    1
    RubySymbol sym;
    Differences
    Expression1Expression2Difference
    org.jruby.RubyModuleorg.jruby.RubySymbolSUBCLASS_TYPE_MISMATCH
    modulesymVARIABLE_NAME_MISMATCH
    org.jruby.RubyModuleorg.jruby.RubySymbolSUBCLASS_TYPE_MISMATCH
    1
    RubySymbol sym;
    2
    if ((module = javaUtilitiesModule) != null)
    2
    if ((module = javaUtilitiesModule) != null)
    2
    if ((sym = symbol) != null)
    Differences
    Expression1Expression2Difference
    modulesymVARIABLE_NAME_MISMATCH
    org.jruby.RubyModuleorg.jruby.RubySymbolSUBCLASS_TYPE_MISMATCH
    javaUtilitiesModulesymbolVARIABLE_NAME_MISMATCH
    org.jruby.RubyModuleorg.jruby.RubySymbolSUBCLASS_TYPE_MISMATCH
    2
    if ((sym = symbol) != null)
    3
    return module;
    3
    return module;
    3
    return sym;
    Differences
    Expression1Expression2Difference
    modulesymVARIABLE_NAME_MISMATCH
    org.jruby.RubyModuleorg.jruby.RubySymbolSUBCLASS_TYPE_MISMATCH
    3
    return sym;
    4
    return javaUtilitiesModule = runtime.fastGetModule("JavaUtilities");
    4
    return javaUtilitiesModule = runtime.fastGetModule("JavaUtilities");
    4
    return symbol = runtime.fastNewSymbol(name);
    Differences
    Expression1Expression2Difference
    javaUtilitiesModulesymbolVARIABLE_NAME_MISMATCH
    org.jruby.RubyModuleorg.jruby.RubySymbolSUBCLASS_TYPE_MISMATCH
    fastGetModulefastNewSymbolMETHOD_INVOCATION_NAME_MISMATCH
    "JavaUtilities"nameTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression javaUtilitiesModule is a field being modified, and thus it cannot be parameterized
    Expression symbol is a field being modified, and thus it cannot be parameterized
    4
    return symbol = runtime.fastNewSymbol(name);
    Precondition Violations (2)
    Row Violation
    1Expression javaUtilitiesModule is a field being modified, and thus it cannot be parameterized
    2Expression symbol is a field being modified, and thus it cannot be parameterized