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 );
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 12 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | do while(isObject && (module = module.getSuperClass()) != null) | | 9 | do while(isObject && (module = module.getSuperClass()) != null) |
5 | | | 4 | |
6 | if ((value = module.constantTableFastFetch(internedName)) != null) | | 5 | if ((value = module.constantTableFetch(name)) != null) |
7 | | | 6 | |
8 | | | 7 | |
9 | return getRuntime().getLoadService().autoloadFor(module.getName() + "::" + internedName) != null; | | 8 | return getRuntime().getLoadService().autoloadFor(module.getName() + "::" + name) != null; |
Precondition Violations (2)
Row |
Violation |
1 | Expression module.constantTableFastFetch(internedName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression module.constantTableFetch(name) cannot be parameterized, because it has dependencies to/from statements that will be extracted |