Session session = openSession(); session.beginTransaction(); session.createQuery( "delete DataPoint" ).executeUpdate(); session.getTransaction().commit(); session.close();
Session s = openSession(); s.beginTransaction(); s.createQuery( "from Zoo where mammals['dog'].description like '%black%'" ).list(); s.getTransaction().commit(); s.close();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/pagination/PaginationTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java
Method name: void cleanupTestData() Method name: void testNakedMapIndex()
Number of AST nodes: 5 Number of AST nodes: 5
1
Session session = openSession();
1
Session s = openSession();
2
		session.beginTransaction();
2
		s.beginTransaction();
3
		session.createQuery( "delete DataPoint" ).executeUpdate();
3
		s.createQuery( "from Zoo where mammals['dog'].description like '%black%'" ).list();
4
		session.getTransaction().commit();
4
		s.getTransaction().commit();
5
		session.close();
5
		s.close();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes having the same super class
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Session session = openSession();
    1
    Session session = openSession();
    1
    Session s = openSession();
    Differences
    Expression1Expression2Difference
    sessionsVARIABLE_NAME_MISMATCH
    1
    Session s = openSession();
    2
    session.beginTransaction();
    2
    session.beginTransaction();
    2
    s.beginTransaction();
    Differences
    Expression1Expression2Difference
    sessionsVARIABLE_NAME_MISMATCH
    2
    s.beginTransaction();
                                                                                                                                                                            
    3
    s.createQuery("from Zoo where mammals['dog'].description like '%black%'").list();
    3
    session.createQuery("delete DataPoint").executeUpdate();
                                                                                                                          
    4
    session.getTransaction().commit();
    4
    session.getTransaction().commit();
    4
    s.getTransaction().commit();
    Differences
    Expression1Expression2Difference
    sessionsVARIABLE_NAME_MISMATCH
    4
    s.getTransaction().commit();
    5
    session.close();
    5
    session.close();
    5
    s.close();
    Differences
    Expression1Expression2Difference
    sessionsVARIABLE_NAME_MISMATCH
    5
    s.close();
    Precondition Violations (0)
    Row Violation