HqlToken hqlToken = (HqlToken)LT(1);
if (hqlToken.isPossibleID()) {
hqlToken.setType(IDENT);
if ( log.isDebugEnabled() ) {
log.debug( "weakKeywords() : new LT(1) token - " + LT( 1 ) );
}
}
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/hql/ast/HqlParser.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java
|
Method name: void weakKeywords()
|
|
Method name: void updateRows(PersistentCollection, Serializable, SessionImplementor)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | HqlToken hqlToken = (HqlToken)LT(1);↵ | | |
|
2 | if (hqlToken.isPossibleID()) {↵ | | |
|
3 | hqlToken.setType(IDENT);↵ | | |
|
4 | ↵ | | 1 | if ( log.isDebugEnabled() ) {↵
|
| | | 2 | log.debug( "Updating rows of collection: " + role + "#" + id );↵
|
| | | 3 | }↵
|
|
| | | 4 | //update all the modified entries↵
|
| | | 5 | int count = doUpdateRows( id, collection, session );↵
|
|
5 | if ( log.isDebugEnabled() ) {↵ | | 6 | if ( log.isDebugEnabled() ) {↵
|
6 | log.debug( "weakKeywords() : new LT(1) token - " + LT( 1 ) );↵ | | |
|
7 | }↵ | | |
|
8 | ↵ | | 7 | log.debug( "done updating rows: " + count + " updated" );↵
|
9 | } | | 8 | }
|
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 6 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
14 | hqlToken.setType(IDENT); | | | |
15 | if (log.isDebugEnabled()) | | 2 | if (log.isDebugEnabled()) |
| | | 3 | log.debug("Updating rows of collection: " + role + "#" + id); |
16 | log.debug("weakKeywords() : new LT(1) token - " + LT(1)); | | | |
Precondition Violations (5)
Row |
Violation |
1 | Unmatched statement hqlToken.setType(IDENT); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement log.debug("Updating rows of collection: " + role + "#"+ id); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement log.debug("weakKeywords() : new LT(1) token - " + LT(1)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement log.debug("weakKeywords() : new LT(1) token - " + LT(1)); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
5 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |