File path: /hibernate-distribution-3.3.2.GA/project/tutorials/web/src/main/java/org/hibernate/tutorial/web/EventManager.java | File path: /hibernate-distribution-3.3.2.GA/project/tutorials/web/src/main/java/org/hibernate/tutorial/web/EventManager.java | |||
Method name: Long createAndStoreEvent(String, Date)
|
Method name: Long createAndStorePerson(String, String)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | Session session = HibernateUtil.getSessionFactory().getCurrentSession();↵ | 1 | Session session = HibernateUtil.getSessionFactory().getCurrentSession();↵ | |
2 | session.beginTransaction();↵ | 2 | session.beginTransaction();↵ | |
3 | Event theEvent = new Event();↵ | 3 | Person thePerson = new Person();↵ | |
4 | theEvent.setTitle(title);↵ | 4 | thePerson.setFirstname(firstname);↵ | |
5 | theEvent.setDate(theDate);↵ | 5 | thePerson.setLastname(lastname);↵ | |
6 | session.save(theEvent);↵ | 6 | session.save(thePerson);↵ | |
7 | session.getTransaction().commit();↵ | 7 | session.getTransaction().commit();↵ | |
8 | return theEvent.getId(); | 8 | return thePerson.getId(); | |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 64 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Session session = HibernateUtil.getSessionFactory().getCurrentSession(); | 1 | Session session = HibernateUtil.getSessionFactory().getCurrentSession(); | |||||||||||||||
2 | session.beginTransaction(); | 2 | session.beginTransaction(); | |||||||||||||||
| 3 | Person thePerson = new Person(); | ||||||||||||||||
3 | Event theEvent = new Event(); | | ||||||||||||||||
|
| 4 | thePerson.setFirstname(firstname); | |||||||||||||||
4 | theEvent.setTitle(title); |
| | |||||||||||||||
|
| 5 | thePerson.setLastname(lastname); | |||||||||||||||
5 | theEvent.setDate(theDate); |
| | |||||||||||||||
6 | session.save(theEvent); |
| 6 | session.save(thePerson); | ||||||||||||||
7 | session.getTransaction().commit(); | 7 | session.getTransaction().commit(); | |||||||||||||||
8 | return theEvent.getId(); |
| 8 | return thePerson.getId(); |
Row | Violation |
---|---|
1 | Unmatched statement thePerson.setFirstname(firstname); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement theEvent.setTitle(title); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement thePerson.setLastname(lastname); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement theEvent.setDate(theDate); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Type org.hibernate.tutorial.domain.Event of variable theEvent does not match with type org.hibernate.tutorial.domain.Person of variable thePerson |
6 | Type org.hibernate.tutorial.domain.Event of variable theEvent does not match with type org.hibernate.tutorial.domain.Person of variable thePerson |