if ( session != null && session.isOpen() ) { try { session.close(); } catch( Throwable ignore ) { } }
if ( session != null ) { try { session.close(); } catch( Throwable t ) {} }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/connections/ConnectionManagementTestCase.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/hql/QueryTranslatorTestCase.java
Method name: void release(Session) Method name: void release(Session)
Number of AST nodes: 3 Number of AST nodes: 3
1
if ( session != null && session.isOpen() ) {
1
if ( session != null ) {
2
			try {
2
			try {
3
				session.close();
3
				session.close();
4
			}
4
			}
5
			catch( Throwable ignore ) {
5
			catch( Throwable 
6
			}
6
t ) {}
7
		}
7
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    2
    try
    Differences
    Expression1Expression2Difference
    ignoretVARIABLE_NAME_MISMATCH
    2
    try
    3
    session.close();
    3
    session.close();
    3
    session.close();
    Differences
    Expression1Expression2Difference
    org.hibernate.Sessionorg.hibernate.classic.SessionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.Session of variable session does not match with type org.hibernate.classic.Session of variable session
    • Make classes org.hibernate.Session and org.hibernate.classic.Session extend a common superclass
    3
    session.close();
    Precondition Violations (1)
    Row Violation
    1Type org.hibernate.Session of variable session does not match with type org.hibernate.classic.Session of variable session