File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/ParentWithBidirectionalManyToMany.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToMany.java | |||
Method name: void newChildren(Collection)
|
Method name: void newChildren(Collection)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if ( getChildren() != null ) {↵ | 1 | if ( getChildren() != null ) {↵ | |
2 | for ( Iterator it = getChildren().iterator(); it.hasNext(); ) {↵ | 2 | for ( Iterator it = getChildren().iterator(); it.hasNext(); ) {↵ | |
3 | ChildWithBidirectionalManyToMany child = ( ChildWithBidirectionalManyToMany ) it.next();↵ | 3 | ChildWithManyToOne child = ( ChildWithManyToOne ) it.next();↵ | |
4 | child.removeParent( this );↵ | 4 | child.setParent( null );↵ | |
5 | }↵ | 5 | }↵ | |
6 | } | 6 |
| |
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 having the same super class |
Number of node comparisons | 10 |
Number of mapped statements | 4 |
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) | 9.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | if (getChildren() != null) | 3 | if (getChildren() != null) | ||||||||||||||||||||||
4 | for (Iterator it = getChildren().iterator(); it.hasNext(); ) | 4 | for (Iterator it = getChildren().iterator(); it.hasNext(); ) | ||||||||||||||||||||||
5 | ChildWithBidirectionalManyToMany child = (ChildWithBidirectionalManyToMany)it.next(); |
| 5 | ChildWithManyToOne child = (ChildWithManyToOne)it.next(); | |||||||||||||||||||||
6 | child.removeParent(this); |
| 6 | child.setParent(null); |
Row | Violation |
---|---|
1 | Expression (ChildWithBidirectionalManyToMany)it.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression (ChildWithManyToOne)it.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression child.removeParent(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression child.setParent(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression child.removeParent(this) is a void method call, and thus it cannot be parameterized |
6 | Expression child.setParent(null) is a void method call, and thus it cannot be parameterized |
7 | Expression child cannot be unified with expression child , because common superclass org.hibernate.test.event.collection.ChildEntity does not declare member(s) public void removeParent(org.hibernate.test.event.collection.association.bidirectional.manytomany.ParentWithBidirectionalManyToMany) , public void setParent(org.hibernate.test.event.collection.ParentWithCollection) |