Session s = openSession();
Transaction tx = s.beginTransaction();
ParentWithCollection parent = createParent( parentName );
s.save( parent );
tx.commit();
s.close();
return parent;
Session s = openSession();
Transaction tx = s.beginTransaction();
ParentWithCollection parent = createParent( parentName );
s.save( parent );
tx.commit();
s.close();
return parent;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/event/collection/BrokenCollectionEventTest.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/event/collection/AbstractCollectionEventTest.java
|
Method name: ParentWithCollection createParentWithNullChildren(String)
|
|
Method name: ParentWithCollection createParentWithNullChildren(String)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
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 | s.save( parent );↵ | | 4 | s.save( parent );↵
|
5 | tx.commit();↵ | | 5 | tx.commit();↵
|
6 | s.close();↵ | | 6 | s.close();↵
|
7 | return parent; | | 7 | return parent;
|
See real code fragment |
|
See real code fragment |
Summary
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 | 29 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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 1 |
Mapped Statements
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 | s.save(parent); | | 4 | s.save(parent); |
5 | tx.commit(); | | 5 | tx.commit(); |
6 | s.close(); | | 6 | s.close(); |
7 | return parent; | | 7 | return parent; |
Precondition Violations (0)
Row |
Violation |