private Long createAndStoreEvent(String title, Date theDate) { Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); Event theEvent = new Event(); theEvent.setTitle(title); theEvent.setDate(theDate); session.save(theEvent); session.getTransaction().commit(); return theEvent.getId();
private Long createAndStorePerson(String firstname, String lastname) { Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); Person thePerson = new Person(); thePerson.setFirstname(firstname); thePerson.setLastname(lastname); session.save(thePerson); session.getTransaction().commit(); return thePerson.getId();
Clone fragments detected by clone detection tool
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
private Long createAndStoreEvent(String title, Date theDate) {
1
private Long createAndStorePerson(String firstname, String lastname) {
2
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
2
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
3
        session.beginTransaction();
3
        session.beginTransaction();
4
        Event theEvent = new Event();
4
        Person thePerson = new Person();
5
        theEvent.setTitle(title);
5
        thePerson.setFirstname(firstname);
6
        theEvent.setDate(theDate);
6
        thePerson.setLastname(lastname);
7
        session.save(theEvent);
7
        session.save(thePerson);
8
        session.getTransaction().commit();
8
        session.getTransaction().commit();
9
        return theEvent.getId();
9
        return thePerson.getId();
10
    
10
    
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0