File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java | |||
Method name: String generateUpdateString(boolean[], int, Object[], boolean)
|
Method name: String generateInsertString(boolean, boolean[], int)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) {↵ | 1 | for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) {↵ | |
2 | if ( includeProperty[i] && isPropertyOfTable( i, j ) ) {↵ | 2 | if ( includeProperty[i] && isPropertyOfTable( i, j ) ) {↵ | |
3 | // this is a property of the table, which we are updating↵ | 3 | // this property ↵ | |
4 | update↵ | 4 | belongs on the table and is to be inserted↵ | |
5 | .addColumns( getPropertyColumnNames(i), propertyColumnUpdateable[i] );↵ | 5 | insert.addColumns( getPropertyColumnNames(i), propertyColumnInsertable[i] );↵ | |
6 | hasColumns = hasColumns || getPropertyColumnSpan( i ) > 0;↵ | 6 | ↵ | |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 7 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
6 | for (int i = 0; i < entityMetamodel.getPropertySpan(); i++) | 2 | for (int i = 0; i < entityMetamodel.getPropertySpan(); i++) | ||||
7 | if (includeProperty[i] && isPropertyOfTable(i, j)) | 3 | if (includeProperty[i] && isPropertyOfTable(i, j)) | ||||
|
| 4 | insert.addColumns(getPropertyColumnNames(i), propertyColumnInsertable[i]); | ||||
8 | update.addColumns(getPropertyColumnNames(i), propertyColumnUpdateable[i]); |
| | ||||
9 | hasColumns = hasColumns || getPropertyColumnSpan(i) > 0; |
| |
Row | Violation |
---|---|
1 | Unmatched statement insert.addColumns(getPropertyColumnNames(i),propertyColumnInsertable[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement update.addColumns(getPropertyColumnNames(i),propertyColumnUpdateable[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement hasColumns=hasColumns || getPropertyColumnSpan(i) > 0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |