File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/event/collection/AbstractCollectionEventTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/event/collection/BrokenCollectionEventTest.java | |||
Method name: ParentWithCollection createParentWithOneChild(String, String)
|
Method name: ParentWithCollection createParentWithOneChild(String, String)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | Session s = openSession();↵ | 1 | Session s = openSession();↵ | |
2 | Transaction tx = s.beginTransaction();↵ | 2 | Transaction tx = s.beginTransaction();↵ | |
3 | ParentWithCollection parent = createParent( parentName );↵ | 3 | ParentWithCollection parent = createParent( parentName );↵ | |
4 | parent.newChildren( createCollection() );↵ | 4 | parent.setChildren( createCollection() );↵ | |
5 | parent.addChild( ChildName );↵ | 5 | parent.addChild( ChildName );↵ | |
6 | s.save( parent );↵ | 6 | s.save( parent );↵ | |
7 | tx.commit();↵ | 7 | tx.commit();↵ | |
8 | s.close();↵ | 8 | s.close();↵ | |
9 | return parent; | 9 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 37 |
Number of mapped statements | 9 |
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) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Session s = openSession(); | 1 | Session s = openSession(); | |||||||||||||||
2 | Transaction tx = s.beginTransaction(); | 2 | Transaction tx = s.beginTransaction(); | |||||||||||||||
3 | ParentWithCollection parent = createParent(parentName); | 3 | ParentWithCollection parent = createParent(parentName); | |||||||||||||||
4 | parent.newChildren(createCollection()); |
| 4 | parent.setChildren(createCollection()); | ||||||||||||||
5 | parent.addChild(ChildName); | 5 | parent.addChild(ChildName); | |||||||||||||||
6 | s.save(parent); | 6 | s.save(parent); | |||||||||||||||
7 | tx.commit(); | 7 | tx.commit(); | |||||||||||||||
8 | s.close(); | 8 | s.close(); | |||||||||||||||
9 | return parent; | 9 | return parent; |
Row | Violation |
---|---|
1 | Expression parent.newChildren(createCollection()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression parent.setChildren(createCollection()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression parent.newChildren(createCollection()) is a void method call, and thus it cannot be parameterized |
4 | Expression parent.setChildren(createCollection()) is a void method call, and thus it cannot be parameterized |