for ( int j = 0; j < lazyPropertyNames.length; j++ ) {
final Object propValue = lazyPropertyTypes[j].assemble(
disassembledValues[ lazyPropertyNumbers[j] ],
session,
entity
);
if ( initializeLazyProperty( fieldName, entity, session, snapshot, j, propValue ) ) {
result = propValue;
}
}
for ( int j = 0; j < lazyPropertyNames.length; j++ ) {
Object propValue = lazyPropertyTypes[j].nullSafeGet( rs, lazyPropertyColumnAliases[j], session, entity );
if ( initializeLazyProperty( fieldName, entity, session, snapshot, j, propValue ) ) {
result = propValue;
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
|
Method name: Object initializeLazyPropertiesFromCache(String, Object, SessionImplementor, EntityEntry, CacheEntry)
|
|
Method name: Object initializeLazyPropertiesFromDatastore(String, Object, SessionImplementor, Serializable, EntityEntry)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for ( int j = 0; j < lazyPropertyNames.length; j++ ) {↵ | | 1 | for ( int j = 0; j < lazyPropertyNames.length; j++ ) {↵
|
2 | final Object propValue = lazyPropertyTypes[j].assemble(↵ | | 2 | Object propValue = lazyPropertyTypes[j].↵
|
3 | disassembledValues[ lazyPropertyNumbers[j] ],↵ | | 3 | nullSafeGet( rs, lazyProperty↵
|
4 | session,↵ | | 4 | ColumnAliases[j], session,↵
|
5 | entity↵ | | 5 | entity );↵
|
6 | );↵ | | 6 | ↵
|
7 | if ( initializeLazyProperty( fieldName, entity, session, snapshot, j, propValue ) ) {↵ | | 7 | if ( initializeLazyProperty( fieldName, entity, session, snapshot, j, propValue ) ) {↵
|
8 | result = propValue;↵ | | 8 | result = propValue;↵
|
9 | }↵ | | 9 | ↵
|
| | | 10 | }↵
|
10 | } | | 11 | }
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | for (int j = 0; j < lazyPropertyNames.length; j++) | | 17 | for (int j = 0; j < lazyPropertyNames.length; j++) |
6 | final Object propValue = lazyPropertyTypes[j].assemble(disassembledValues[lazyPropertyNumbers[j]], session, entity); | | | |
| | | 18 | Object propValue = lazyPropertyTypes[j].nullSafeGet(rs, lazyPropertyColumnAliases[j], session, entity); |
7 | if (initializeLazyProperty(fieldName, entity, session, snapshot, j, propValue)) | | 19 | if (initializeLazyProperty(fieldName, entity, session, snapshot, j, propValue)) |
8 | | | 20 | |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched statement final Object propValue=lazyPropertyTypes[j].assemble(disassembledValues[lazyPropertyNumbers[j]],session,entity); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement Object propValue=lazyPropertyTypes[j].nullSafeGet(rs,lazyPropertyColumnAliases[j],session,entity); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Clone fragment #1 returns variables j, result , while Clone fragment #2 returns variables j, result |