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)
|
Method name: boolean isSame(Object, Object, EntityMode)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | if ( x == y ) {↵ | 1 | if ( x == y ) {↵ | |
2 | return true;↵ | 2 | return true;↵ | |
3 | }↵ | 3 | }↵ | |
4 | if ( x == null || y == null ) {↵ | 4 | if ( x == null || y == null ) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | Object[] xvalues = getPropertyValues( x, entityMode );↵ | 7 | Object[] xvalues = getPropertyValues( x, entityMode );↵ | |
8 | Object[] yvalues = getPropertyValues( y, entityMode );↵ | 8 | Object[] yvalues = getPropertyValues( y, entityMode );↵ | |
9 | for ( int i = 0; i < propertySpan; i++ ) {↵ | 9 | for ( int i = 0; i < propertySpan; i++ ) {↵ | |
10 | if ( !propertyTypes[i].isEqual( xvalues[i], yvalues[i], entityMode ) ) {↵ | 10 | if ( !propertyTypes[i].isSame( xvalues[i], yvalues[i], entityMode ) ) {↵ | |
11 | return false;↵ | 11 | return false;↵ | |
12 | }↵ | 12 | }↵ | |
13 | }↵ | 13 | }↵ | |
14 | return true; | 14 |
| |
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.7 |
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 | 0 |
Time elapsed for statement mapping (ms) | 1.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (x == y) | 1 | if (x == y) | |||||||||||||
2 | return true; | 2 | return true; | |||||||||||||
3 | if (x == null || y == null) | 3 | if (x == null || y == null) | |||||||||||||
4 | return false; | 4 | return false; | |||||||||||||
5 | Object[] xvalues = getPropertyValues(x, entityMode); | 5 | Object[] xvalues = getPropertyValues(x, entityMode); | |||||||||||||
6 | Object[] yvalues = getPropertyValues(y, entityMode); | 6 | Object[] yvalues = getPropertyValues(y, entityMode); | |||||||||||||
7 | for (int i = 0; i < propertySpan; i++) | 7 | for (int i = 0; i < propertySpan; i++) | |||||||||||||
8 | if (!propertyTypes[i].isEqual(xvalues[i], yvalues[i], entityMode)) |
| 8 | if (!propertyTypes[i].isSame(xvalues[i], yvalues[i], entityMode)) | ||||||||||||
9 | return false; | 9 | return false; | |||||||||||||
10 | return true; | 10 | return true; |
Row | Violation |
---|---|
1 | Expression propertyTypes[i].isEqual(xvalues[i],yvalues[i],entityMode) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression propertyTypes[i].isSame(xvalues[i],yvalues[i],entityMode) cannot be parameterized, because it has dependencies to/from statements that will be extracted |