do { Object value; if ((value = module.constantTableFastFetch(internedName)) != null) { if (value != UNDEF) return true; return getRuntime().getLoadService().autoloadFor( module.getName() + "::" + internedName) != null; } } while (isObject && (module = module.getSuperClass()) != null );
do { Object value; if ((value = module.constantTableFetch(name)) != null) { if (value != UNDEF) return true; return getRuntime().getLoadService().autoloadFor( module.getName() + "::" + name) != null; } } while (isObject && (module = module.getSuperClass()) != null );
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyModule.java File path: /jruby-1.4.0/src/org/jruby/RubyModule.java
Method name: boolean fastIsConstantDefined(String) Method name: boolean isConstantDefined(String)
Number of AST nodes: 6 Number of AST nodes: 6
1
do {
1
do {
2
            Object value;
2
            Object value;
3
            if ((value = module.constantTableFastFetch(internedName)) != null) {
3
            if ((value = module.constantTableFetch(name)) != null) {
4
                if (value != UNDEF) return true;
4
                if (value != UNDEF) return true;
5
                return getRuntime().getLoadService().autoloadFor(
5
                return getRuntime().getLoadService().autoloadFor(
6
                        module.getName() + "::" + internedName) != null;
6
                        module.getName() + "::" + name) != null;
7
            }
7
            }
8
        } while (isObject && (module = module.getSuperClass()) != null );
8
        } while (isObject && (module = module.getSuperClass()) != null );
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.7
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    do while(isObject && (module = module.getSuperClass()) != null)
    9
    do while(isObject && (module = module.getSuperClass()) != null)
    5
    Object value;
    4
    Object value;
    6
    if ((value = module.constantTableFastFetch(internedName)) != null)
    6
    if ((value = module.constantTableFastFetch(internedName)) != null)
    5
    if ((value = module.constantTableFetch(name)) != null)
    Differences
    Expression1Expression2Difference
    constantTableFastFetchconstantTableFetchMETHOD_INVOCATION_NAME_MISMATCH
    internedNamenameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression module.constantTableFastFetch(internedName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression module.constantTableFetch(name) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    if ((value = module.constantTableFetch(name)) != null)
    7
    if (value != UNDEF)
    6
    if (value != UNDEF)
    8
    return true;
    7
    return true;
    9
    return getRuntime().getLoadService().autoloadFor(module.getName() + "::" + internedName) != null;
    9
    return getRuntime().getLoadService().autoloadFor(module.getName() + "::" + internedName) != null;
    8
    return getRuntime().getLoadService().autoloadFor(module.getName() + "::" + name) != null;
    Differences
    Expression1Expression2Difference
    internedNamenameVARIABLE_NAME_MISMATCH
    8
    return getRuntime().getLoadService().autoloadFor(module.getName() + "::" + name) != null;
    Precondition Violations (2)
    Row Violation
    1Expression module.constantTableFastFetch(internedName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression module.constantTableFetch(name) cannot be parameterized, because it has dependencies to/from statements that will be extracted