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
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    14
    hqlToken.setType(IDENT);
    14
    hqlToken.setType(IDENT);
    Preondition Violations
    Unmatched statement hqlToken.setType(IDENT); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                            
    15
    if (log.isDebugEnabled())
    2
    if (log.isDebugEnabled())
                                                                                                                                  
    3
    log.debug("Updating rows of collection: " + role + "#" + id);
    Preondition Violations
    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
    log.debug("Updating rows of collection: " + role + "#" + id);
    16
    log.debug("weakKeywords() : new LT(1) token - " + LT(1));
    16
    log.debug("weakKeywords() : new LT(1) token - " + LT(1));
    Preondition Violations
    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
    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
                                                                                                                              
    Precondition Violations (5)
    Row Violation
    1Unmatched statement hqlToken.setType(IDENT); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched 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
    3Unmatched 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
    4Unmatched 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
    5The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero