File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/ComponentType.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/ComponentType.java | |||
Method name: boolean isEqual(Object, Object, EntityMode, SessionFactoryImplementor)
|
Method name: boolean isDirty(Object, Object, SessionImplementor)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 11 | |||
1 | if ( x == y ) {↵ | 1 | if ( x == y ) {↵ | |
2 | return true;↵ | 2 | return false;↵ | |
3 | }↵ | 3 | }↵ | |
4 | if ( x == null || y == null ) {↵ | 4 | if ( x == null || y == null ) {↵ | |
5 | return false;↵ | 5 | return true;↵ | |
6 | }↵ | 6 | }↵ | |
7 | ↵ | 7 | EntityMode entityMode = session.getEntityMode();↵ | |
8 | Object[] xvalues = getPropertyValues( x, entityMode );↵ | 8 | Object[] xvalues = getPropertyValues( x, entityMode );↵ | |
9 | Object[] yvalues = getPropertyValues( y, entityMode );↵ | 9 | Object[] yvalues = getPropertyValues( y, entityMode );↵ | |
10 | for ( int i = 0; i < propertySpan; i++ ) {↵ | 10 | for ( int i = 0; i < xvalues.length; i++ ) {↵ | |
11 | if ( !propertyTypes[i].isEqual( xvalues[i], yvalues[i], entityMode, factory ) ) {↵ | 11 | if ( propertyTypes[i].isDirty( xvalues[i], yvalues[i], session ) ) {↵ | |
12 | return false;↵ | 12 | return true;↵ | |
13 | }↵ | 13 | }↵ | |
14 | }↵ | 14 | }↵ | |
15 | return true; | 15 | return false; | |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 27 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 4.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (x == y) | 1 | if (x == y) | |||||||||||||
2 | return true; |
| 2 | return false; | ||||||||||||
3 | if (x == null || y == null) | 3 | if (x == null || y == null) | |||||||||||||
4 | return false; |
| 4 | return true; | ||||||||||||
|
| 5 | EntityMode entityMode = session.getEntityMode(); | |||||||||||||
5 | Object[] xvalues = getPropertyValues(x, entityMode); | 6 | Object[] xvalues = getPropertyValues(x, entityMode); | |||||||||||||
6 | Object[] yvalues = getPropertyValues(y, entityMode); | 7 | Object[] yvalues = getPropertyValues(y, entityMode); | |||||||||||||
7 | for (int i = 0; i < propertySpan; i++) |
| 8 | for (int i = 0; i < xvalues.length; i++) | ||||||||||||
8 | if (!propertyTypes[i].isEqual(xvalues[i], yvalues[i], entityMode, factory)) |
| 9 | if (propertyTypes[i].isDirty(xvalues[i], yvalues[i], session)) | ||||||||||||
9 | return false; |
| 10 | return true; | ||||||||||||
10 | return true; |
| 11 | return false; |
Row | Violation |
---|---|
1 | Unmatched statement EntityMode entityMode=session.getEntityMode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Expression xvalues.length cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression !propertyTypes[i].isEqual(xvalues[i],yvalues[i],entityMode,factory) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression propertyTypes[i].isDirty(xvalues[i],yvalues[i],session) cannot be parameterized, because it has dependencies to/from statements that will be extracted |