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/sql/Update.java | |||
Method name: String getWhereCondition()
|
Method name: String toStatementString()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | while ( criterionIterator.hasNext() ) {↵ | 1 | while ( iter.hasNext() ) {↵ | |
2 | CriteriaImpl.CriterionEntry entry = ( CriteriaImpl.CriterionEntry ) criterionIterator.next();↵ | 2 | Map.Entry e = (Map.Entry) iter.next();↵ | |
3 | String sqlString = entry.getCriterion().toSqlString( entry.getCriteria(), this );↵ | 3 | ↵ | |
4 | condition.append( sqlString );↵ | 4 | buf.append( e.getKey() ).append( '=' ).append( e.getValue() );↵ | |
5 | if ( criterionIterator.hasNext() ) {↵ | 5 | if ( iter.hasNext() ) {↵ | |
6 | condition.append( " and " );↵ | 6 | buf.append( ", " );↵ | |
7 | }↵ | 7 | }↵ | |
8 | ↵ | 8 | assignmentsAppended = true;↵ | |
9 | } | 9 | } | |
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 | 20 |
Number of mapped statements | 3 |
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.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | while (criterionIterator.hasNext()) |
| 7 | while (iter.hasNext()) | |||||||||||||
4 | CriteriaImpl.CriterionEntry entry = (CriteriaImpl.CriterionEntry)criterionIterator.next(); |
| | ||||||||||||||
5 | String sqlString = entry.getCriterion().toSqlString(entry.getCriteria(), this); |
| | ||||||||||||||
6 | condition.append(sqlString); | | |||||||||||||||
|
| 8 | Map.Entry e = (Map.Entry)iter.next(); | ||||||||||||||
| 9 | buf.append(e.getKey()).append('=').append(e.getValue()); | |||||||||||||||
7 | if (criterionIterator.hasNext()) |
| 10 | if (iter.hasNext()) | |||||||||||||
8 | condition.append(" and "); |
| 11 | buf.append(", "); | |||||||||||||
|
| 12 | assignmentsAppended = true; |
Row | Violation |
---|---|
1 | Unmatched statement CriteriaImpl.CriterionEntry entry=(CriteriaImpl.CriterionEntry)criterionIterator.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement String sqlString=entry.getCriterion().toSqlString(entry.getCriteria(),this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement String sqlString=entry.getCriterion().toSqlString(entry.getCriteria(),this); 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 |
4 | Unmatched statement Map.Entry e=(Map.Entry)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement assignmentsAppended=true; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |