log.info( "Reading mappings from resource: " + resourceName ); InputStream rsrc = classLoader.getResourceAsStream( resourceName ); if ( rsrc == null ) { throw new MappingNotFoundException( "resource", resourceName ); } try { return addInputStream( rsrc ); } catch (MappingException me) { throw new InvalidMappingException( "resource", resourceName, me ); }
try { QueryableCollection queryableCollection = ( QueryableCollection ) sfi.getCollectionPersister( role ); if ( queryableCollection != null ) { collectionPropertyMappingByRole.put( role, new CollectionPropertyMapping( queryableCollection ) ); } return queryableCollection; } catch ( ClassCastException cce ) { throw new QueryException( "collection role is not queryable: " + role ); } catch ( Exception e ) { throw new QueryException( "collection role not found: " + role ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/util/SessionFactoryHelper.java
Method name: Configuration addResource(String, ClassLoader) Method name: QueryableCollection requireQueryableCollection(String)
Number of AST nodes: 6 Number of AST nodes: 5
1
log.info( "Reading mappings from resource: " + resourceName );
2
		InputStream rsrc = classLoader.getResourceAsStream( resourceNam
1
try {
3
e );
2
			QueryableCollection queryableCollection = ( QueryableCollection ) sfi.getCollectionPersister( role );
4
		if ( rsrc == null ) {
3
			if ( 
5
			throw new MappingNotFoundException( "resource", resourceName );
6
		}
7
		try {
8
			return addInputStream( rsrc
4
queryableCollection != null ) {
5
				collectionPropertyMappingByRole.put( role, new CollectionPropertyMapping( queryableCollection ) );
6
			}
7
			return queryableCollection;
8
		}
9
		catch ( ClassCastException cce ) {
9
 );
10
			throw new QueryException( "collection role is not queryable: " + role );
10
		}
11
		}
11
		catch (MappingException me) {
12
		catch ( Exception e ) {
12
			throw new InvalidMappingException( "resource", resourceName, me );
13
			throw new QueryException( "collection role not found: " + role );
13
		}
14
		}
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.1
Clones locationClones are in different classes
Number of node comparisons2