if (subselect == null) {
return null;
}
else {
// Take care of any entities that might have
// been evicted!
Iterator iter = subselect.getResult().iterator();
while ( iter.hasNext() ) {
if ( !persistenceContext.containsEntity( (EntityKey) iter.next() ) ) {
iter.remove();
}
}
// Run a subquery loader
return createSubselectInitializer( subselect, session );
}
while ( subProperties.hasNext() ) {
Property prop = ( Property ) subProperties.next();
if ( prop.getGeneration() == PropertyGeneration.ALWAYS ) {
return true;
}
else if ( prop.getValue() instanceof Component ) {
if ( hasPartialUpdateComponentGeneration( ( Component ) prop.getValue() ) ) {
return true;
}
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java
|
Method name: CollectionInitializer getSubselectInitializer(Serializable, SessionImplementor)
|
|
Method name: boolean hasPartialUpdateComponentGeneration(Component)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (subselect == null) {↵ | | 1 | while ( subProperties.hasNext() ) {
↵
|
2 | return null;↵ | | 2 | ↵
|
3 | }↵ | | |
|
4 | else {↵ | | |
|
5 | ↵ | | |
|
6 | // Take care of any entities that might have↵ | | |
|
7 | // been evicted! ↵ | | |
|
8 | Iterator iter = subselect.getResult().iterator();↵ | | |
|
9 | while ( iter.hasNext()↵ | | 3 | Property prop = ( Property ) subProperties.next();↵
|
| | | 4 | if ( prop.getGeneration() == PropertyGeneration.ALWAYS ) {↵
|
| | | 5 | return true;↵
|
| | | 6 | }↵
|
10 | ) {↵ | | 7 | else if ( prop.getValue() instanceof Component ) {
↵
|
11 | if ( !persistenceContext.containsEntity( (EntityKey) iter.next() ) ) {↵ | | 8 | if ( hasPartialUpdateComponentGeneration( ( Component ) prop.getValue() ) ) {
↵
|
12 | iter.remove();↵ | | 9 | return true;
↵
|
13 | }↵ | | 10 | }
↵
|
14 | } ↵ | | 11 | }↵
|
15 | ↵ | | |
|
16 | // Run a subquery loader↵ | | |
|
17 | return createSubselectInitializer( subselect, session );↵ | | 12 |
↵
|
18 | } | | 13 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
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) | 6.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
9 | if (!persistenceContext.containsEntity((EntityKey)iter.next())) | | 7 | if (hasPartialUpdateComponentGeneration((Component)prop.getValue())) |
| | | 8 | |
10 | | | | |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched return true; |