Element elem = (Element) elements.get(i); Object object = elementType.fromXMLNode( elem, persister.getFactory() ); if ( elementType.isDirty( old, object, getSession() ) ) result.add(old);
joinFragment.addCrossJoin( rootJoinable.getTableName(), rootAlias ); String filterCondition = rootJoinable.filterFragment( rootAlias, enabledFilters ); // JoinProcessor needs to know if the where clause fragment came from a dynamic filter or not so it // can put the where clause fragment in the right place in the SQL AST. 'hasFilterCondition' keeps track // of that fact. joinFragment.setHasFilterCondition( joinFragment.addCondition( filterCondition ) ); if (includeExtraJoins) { //TODO: not quite sure about the full implications of this! addExtraJoins( joinFragment, rootAlias, rootJoinable, true ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/collection/PersistentElementHolder.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/JoinSequence.java
Method name: Iterator getDeletes(CollectionPersister, boolean) Method name: JoinFragment toJoinFragment(Map, boolean, String, String)
Number of AST nodes: 4 Number of AST nodes: 5
1
Element elem = (Element) elements.get(i);
2
				Object object = elementType.fromXMLNode( elem, persister.getFactory() );
3
				if ( elementType.isDirty( old, object, getSess
1
joinFragment.addCrossJoin( rootJoinable.getTableName(), rootAlias );
2
			String filterCondition = rootJoinable.filterFragment( rootAlias, enabledFilters );
3
			// JoinProcessor needs to know if the where clause fragment came from a dynamic filter or not so it
4
			// can put the where clause fragment in the right place in the SQL AST.   'hasFilterCondition' keeps track
5
			// of that fact.
4
ion() ) ) result.add(old);
6
			joinFragment.setHasFilterCondition( joinFragment.addCondition( filterCondition ) );
7
			if (includeExtraJoins) { //TODO: not quite sure about the full implications of this!
8
				addExtraJoins( joinFragment, rootAlias, rootJoinable, true );
9
			}
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 comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)2329.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                            
    3
    joinFragment.addCrossJoin(rootJoinable.getTableName(), rootAlias);
                                                                                                                                                                    
    4
    String filterCondition = rootJoinable.filterFragment(rootAlias, enabledFilters);
                                                                                                                                                                        
    5
    joinFragment.setHasFilterCondition(joinFragment.addCondition(filterCondition));
    Preondition Violations
    Unmatched statement joinFragment.setHasFilterCondition(joinFragment.addCondition(filterCondition)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    joinFragment.setHasFilterCondition(joinFragment.addCondition(filterCondition));
    9
    Element elem = (Element)elements.get(i);
                                                                                      
    10
    Object object = elementType.fromXMLNode(elem, persister.getFactory());
    10
    Object object = elementType.fromXMLNode(elem, persister.getFactory());
    Preondition Violations
    Unmatched statement Object object=elementType.fromXMLNode(elem,persister.getFactory()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                  
    11
    if (elementType.isDirty(old, object, getSession()))
    11
    if (elementType.isDirty(old, object, getSession()))
    6
    if (includeExtraJoins)
    Differences
    Expression1Expression2Difference
    elementType.isDirty(old,object,getSession())includeExtraJoinsTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression elementType.isDirty(old,object,getSession()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (includeExtraJoins)
                                                                                                                          
    7
    addExtraJoins(joinFragment, rootAlias, rootJoinable, true);
    12
    result.add(old);
    12
    result.add(old);
    Preondition Violations
    Unmatched statement result.add(old); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                            
    Precondition Violations (5)
    Row Violation
    1Unmatched statement joinFragment.setHasFilterCondition(joinFragment.addCondition(filterCondition)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement Object object=elementType.fromXMLNode(elem,persister.getFactory()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression elementType.isDirty(old,object,getSession()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched statement result.add(old); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero