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/mapping/Table.java | |||
Method name: QueryParameters getQueryParameters()
|
Method name: String sqlCreateString(Dialect, Mapping, String, String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | while ( iter.hasNext() ) {↵ | 1 | while ( ukiter.hasNext() ) {↵ | |
2 | CriteriaImpl.Subcriteria subcriteria = ( CriteriaImpl.Subcriteria ) iter.next();↵ | 2 | ↵ | |
3 | LockMode lm = subcriteria.getLockMode(↵ | 3 | UniqueKey uk = (UniqueKey) ukiter.next();↵ | |
4 | );↵ | 4 | String constraint = uk.sqlConstraintString( dialect );↵ | |
5 | if ( lm != null ) {↵ | 5 | if ( constraint != null ) {↵ | |
6 | lockModes.put( getSQLAlias( subcriteria ), lm );↵ | 6 | buf.append( ", " ).append( constraint );↵ | |
7 | }↵ | 7 | }↵ | |
8 | } | 8 | } | |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 2 |
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) | 2.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24 | while (iter.hasNext()) |
| 38 | while (ukiter.hasNext()) | ||||||||||||||
25 | CriteriaImpl.Subcriteria subcriteria = (CriteriaImpl.Subcriteria)iter.next(); |
| | |||||||||||||||
26 | LockMode lm = subcriteria.getLockMode(); |
| | |||||||||||||||
|
| 39 | UniqueKey uk = (UniqueKey)ukiter.next(); | |||||||||||||||
|
| 40 | String constraint = uk.sqlConstraintString(dialect); | |||||||||||||||
27 | if (lm != null) |
| 41 | if (constraint != null) | ||||||||||||||
28 | lockModes.put(getSQLAlias(subcriteria), lm); |
| | |||||||||||||||
|
| 42 | buf.append(", ").append(constraint); |
Row | Violation |
---|---|
1 | Unmatched statement CriteriaImpl.Subcriteria subcriteria=(CriteriaImpl.Subcriteria)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement LockMode lm=subcriteria.getLockMode(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement UniqueKey uk=(UniqueKey)ukiter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement String constraint=uk.sqlConstraintString(dialect); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Type org.hibernate.LockMode of variable lm does not match with type java.lang.String of variable constraint |
6 | Unmatched statement lockModes.put(getSQLAlias(subcriteria),lm); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched statement buf.append(", ").append(constraint); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
8 | The refactoring of the clones is infeasible, because classes org.hibernate.loader.criteria.CriteriaQueryTranslator and org.hibernate.mapping.Table do not have a common superclass |