criteriaEntityNames.put( rootCriteria, rootEntityName ); Iterator iter = associationPathCriteriaMap.entrySet().iterator(); while ( iter.hasNext() ) { Map.Entry me = ( Map.Entry ) iter.next(); criteriaEntityNames.put( me.getValue(), //the criteria instance getPathEntityName( ( String ) me.getKey() ) ); }
while ( iter.hasNext() ) { Map.Entry element = ( Map.Entry ) iter.next(); String path = ( String ) element.getKey(); if ( path.startsWith( keyPrefix ) ) { result.put( path.substring( keyPrefix.length() ), element.getValue() ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/custom/sql/SQLQueryReturnProcessor.java
Method name: void createCriteriaEntityNameMap() Method name: Map filter(Map)
Number of AST nodes: 5 Number of AST nodes: 5
1
criteriaEntityNames.put( rootCriteria, rootEntityName );
2
		Iterator iter = associationPathCriteriaMap.entrySet().iterator();
3
		while ( iter.hasNext() ) {
1
while ( iter.hasNext() ) {
4
			Map.Entry me = ( Map.Entry ) iter.next();
2
			Map.Entry element = ( Map.Entry ) iter.next();
5
			criteriaEntityNames.put(
3
			
6
					me.getValue(), //the criteria instance
7
			        getPathEntityName( ( String ) me.getKey
4
String path = ( String ) element.getKey();
5
			if ( path.startsWith( keyPrefix ) ) {
8
() )
6
				result.put( path.substring( keyPrefix.length() ), element.getValue() );
9
			);
7
			}
10
		}
8
		}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons1