log.trace("Need to execute flush");
performExecutions(source);
postFlush(source);
// note: performExecutions() clears all collectionXxxxtion
// collections (the collection actions) in the session
if ( source.getFactory().getStatistics().isStatisticsEnabled() ) {
source.getFactory().getStatisticsImplementor().flush();
}
if ( source.getPersistenceContext().hasNonReadOnlyEntities() ) {
flushEverythingToExecutions(event);
performExecutions(source);
postFlush(source);
if ( source.getFactory().getStatistics().isStatisticsEnabled() ) {
source.getFactory().getStatisticsImplementor().flush();
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/DefaultAutoFlushEventListener.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/DefaultFlushEventListener.java
|
Method name: void onAutoFlush(AutoFlushEvent)
|
|
Method name: void onFlush(FlushEvent)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 6
|
|
1 | log.trace("Need to execute flush"↵ | | 1 | if ( source.getPersistenceContext().hasNonReadOnlyEntities() ) {↵
|
| | | 2 | ↵
|
2 | );↵ | | 3 | flushEverythingToExecutions(event);↵
|
|
3 | performExecutions(source);↵ | | 4 | performExecutions(source);↵
|
4 | postFlush(source);↵ | | 5 | postFlush(source);↵
|
5 | // note: performExecutions() clears all collectionXxxxtion ↵ | | 6 | ↵
|
6 | // collections (the collection actions) in the session↵ | | |
|
|
7 | ↵ | | |
|
8 | if ( source.getFactory().getStatistics().isStatisticsEnabled() ) {↵ | | 7 | if ( source.getFactory().getStatistics().isStatisticsEnabled() ) {↵
|
9 | source.getFactory().getStatisticsImplementor().flush();↵ | | 8 | source.getFactory().getStatisticsImplementor().flush();↵
|
10 | ↵ | | 9 | }↵
|
| | | 10 | ↵
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 14 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 3 | flushEverythingToExecutions(event); |
6 | log.trace("Need to execute flush"); | | | |
7 | performExecutions(source); | | 4 | performExecutions(source); |
8 | postFlush(source); | | 5 | postFlush(source); |
9 | if (source.getFactory().getStatistics().isStatisticsEnabled()) | | 6 | if (source.getFactory().getStatistics().isStatisticsEnabled()) |
10 | source.getFactory().getStatisticsImplementor().flush(); | | 7 | source.getFactory().getStatisticsImplementor().flush(); |
Precondition Violations (0)
Row |
Violation |