File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Update.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Update.java | |||
Method name: String toStatementString()
|
Method name: String toStatementString()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 6 | |||
1 | while ( iter.hasNext() ) {↵ | |||
1 | Map.Entry e = (Map.Entry) iter.next();↵ | 2 | final Map.Entry e = (Map.Entry) iter.next();↵ | |
2 | buf.append( e.getKey() ).append( '=' ).append( e.getValue() );↵ | 3 | ↵ | |
3 | if ( iter.hasNext() ) {↵ | |||
4 | buf.append( ", " );↵ | |||
5 | }↵ | |||
6 | assignment↵ | 4 | if ( conditionsAppended ) {↵ | |
5 | buf.append( " and " );↵ | |||
6 | }↵ | |||
7 | buf.append( e.getKey() ).append( e.getValue() );↵ | |||
7 | sAppended = true; | 8 | conditionsAppended = true;↵ | |
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.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 14 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | Map.Entry e = (Map.Entry)iter.next(); | | |||||||||||||
9 | buf.append(e.getKey()).append('=').append(e.getValue()); | | |||||||||||||
| 30 | final Map.Entry e = (Map.Entry)iter.next(); | |||||||||||||
10 | if (iter.hasNext()) |
| 31 | if (conditionsAppended) | |||||||||||
11 | buf.append(", "); |
| 32 | buf.append(" and "); | |||||||||||
| 33 | buf.append(e.getKey()).append(e.getValue()); | |||||||||||||
12 | assignmentsAppended = true; |
| 34 | conditionsAppended = true; |
Row | Violation |
---|---|
1 | Expression conditionsAppended cannot be parameterized, because it has dependencies to/from statements that will be extracted |