File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/WrapVisitor.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/ComponentType.java | |||
Method name: Object processComponent(Object, AbstractComponentType)
|
Method name: int getHashCode(Object, EntityMode, SessionFactoryImplementor)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | for ( int i=0; i<types.length; i++ ) {↵ | 1 | for ( int i = 0; i < propertySpan; i++ ) {↵ | |
2 | Object result = processValue( values[i], types[i] )↵ | 2 | Object y = values[i];↵ | |
3 | ;↵ | 3 | result *= 37;↵ | |
4 | if (result!=null) {↵ | 4 | if ( y != null ) {↵ | |
5 | values[i] = result;↵ | 5 | ↵ | |
6 | substituteComponent = true;↵ | 6 | result += propertyTypes[i].getHashCode( y, entityMode, factory );↵ | |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
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) | 9.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | for (int i = 0; i < types.length; i++) |
| 3 | for (int i = 0; i < propertySpan; i++) | |||||||||||||||
6 | Object result = processValue(values[i], types[i]); |
| 4 | Object y = values[i]; | |||||||||||||||
|
| 5 | result *= 37; | ||||||||||||||||
7 | if (result != null) |
| 6 | if (y != null) | |||||||||||||||
|
| 7 | result += propertyTypes[i].getHashCode(y, entityMode, factory); | ||||||||||||||||
8 | values[i] = result; |
| | ||||||||||||||||
9 | substituteComponent = true; |
| |
Row | Violation |
---|---|
1 | Expression processValue(values[i],types[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression values[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement result*=37; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement result+=propertyTypes[i].getHashCode(y,entityMode,factory); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement result+=propertyTypes[i].getHashCode(y,entityMode,factory); 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 |
6 | Unmatched statement values[i]=result; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement substituteComponent=true; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Clone fragment #1 returns variables i, result , while Clone fragment #2 returns variables i, y |
9 | The refactoring of the clones is infeasible, because classes org.hibernate.event.def.WrapVisitor and org.hibernate.type.ComponentType do not have a common superclass |