while ( orphanIter.hasNext() ) {
Object orphan = orphanIter.next();
if (orphan!=null) {
if ( log.isTraceEnabled() ) {
log.trace("deleting orphaned entity instance: " + entityName);
}
eventSource.delete( entityName, orphan, false, new HashSet() );
}
}
if ( !isInverse && collection.isRowUpdatePossible() ) {
if ( log.isDebugEnabled() ) {
log.debug( "Updating rows of collection: " + role + "#" + id );
}
//update all the modified entries
int count = doUpdateRows( id, collection, session );
if ( log.isDebugEnabled() ) {
log.debug( "done updating rows: " + count + " updated" );
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/Cascade.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java
|
Method name: void deleteOrphans(String, PersistentCollection)
|
|
Method name: void updateRows(PersistentCollection, Serializable, SessionImplementor)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | while ( orphanIter.hasNext() ) {↵ | | |
|
2 | Object orphan = orphanIter.next();↵ | | |
|
3 | if (orphan!=null) {↵ | | 1 | if ( !isInverse && collection.isRowUpdatePossible() ) {↵
|
4 | ↵ | | |
|
5 | if ( log.isTraceEnabled() ) {↵ | | 2 | if ( log.isDebugEnabled() ) {↵
|
6 | log.trace("deleting orphaned entity instance: " + entityName);↵ | | 3 | log.debug( "Updating rows of collection: " + role + "#" + id );↵
|
7 | }↵ | | 4 | }↵
|
|
8 | eventSource.delete( entityName, orphan, false, new HashSet()↵ | | 5 | //update all the modified entries↵
|
| | | 6 | int count = doUpdateRows( id, collection, session );↵
|
|
| | | 7 | if ( log.isDebugEnabled() ) {↵
|
9 | );↵ | | 8 | log.debug( "done updating rows: " + count + " updated" );↵
|
10 | }↵ | | 9 | }↵
|
11 | } | | 10 | }
|
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 6 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
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.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | if (log.isTraceEnabled()) | | 2 | if (log.isDebugEnabled()) |
11 | log.trace("deleting orphaned entity instance: " + entityName); | | 3 | log.debug("Updating rows of collection: " + role + "#" + id); |
Precondition Violations (2)
Row |
Violation |
1 | Expression log.trace("deleting orphaned entity instance: " + entityName) is a void method call, and thus it cannot be parameterized |
2 | Expression log.debug("Updating rows of collection: " + role + "#"+ id) is a void method call, and thus it cannot be parameterized |