File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/entity/EntityTuplizerFactory.java | |||
Method name: Object readIdentifier(ResultSet, String, SessionImplementor)
|
Method name: EntityTuplizer constructDefaultTuplizer(EntityMode, EntityMetamodel, PersistentClass)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | Object id = getIdentifierType().nullSafeGet( rs, alias, session, null );↵ | |||
2 | if ( id↵ | 1 | Class tuplizerClass = ( Class ) defaultImplClassByMode.get( entityMode );↵ | |
3 | == null ) {↵ | 2 | if ( tuplizerClass == null ) {↵ | |
4 | throw new HibernateException( "null identifier column for collection: " + role );↵ | 3 | throw new HibernateException( "could not determine default tuplizer class to use [" + entityMode + "]" );↵ | |
5 | }↵ | 4 | }↵ | |
6 | return id; | 5 | return constructTuplizer( tuplizerClass, metamodel, persistentClass ); | |
See real code fragment | See real code fragment |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Class tuplizerClass = (Class)defaultImplClassByMode.get(entityMode); | ||||||||||||||||
1 | Object id = getIdentifierType().nullSafeGet(rs, alias, session, null); | | ||||||||||||||||
2 | if (id == null) |
| 2 | if (tuplizerClass == null) | ||||||||||||||
|
| 3 | throw new HibernateException("could not determine default tuplizer class to use [" + entityMode + "]"); | |||||||||||||||
3 | throw new HibernateException("null identifier column for collection: " + role); |
| | |||||||||||||||
|
| 4 | return constructTuplizer(tuplizerClass, metamodel, persistentClass); | |||||||||||||||
4 | return id; |
| |
Row | Violation |
---|---|
1 | Type java.lang.Object of variable id does not match with type java.lang.Class of variable tuplizerClass |
2 | Unmatched statement throw new HibernateException("could not determine default tuplizer class to use [" + entityMode + "]"); 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 |
3 | Unmatched throw new HibernateException("could not determine default tuplizer class to use [" + entityMode + "]"); |
4 | Unmatched statement throw new HibernateException("null identifier column for collection: " + role); 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 | Unmatched throw new HibernateException("null identifier column for collection: " + role); |
6 | Unmatched statement return constructTuplizer(tuplizerClass,metamodel,persistentClass); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched return constructTuplizer(tuplizerClass,metamodel,persistentClass); |
8 | Unmatched statement return id; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
9 | Unmatched return id; |
10 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |