if ( loadContexts == null ) { loadContexts = new LoadContexts( this ); } return loadContexts;
if ( extendedJTATransaction == null ) { extendedJTATransaction = NamingHelper.getInitialContext( props ) .lookup( "java:comp/websphere/ExtendedJTATransaction" ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transaction/WebSphereExtendedJTATransactionLookup.java
Method name: LoadContexts getLoadContexts() Method name: void TransactionAdapter(Properties)
Number of AST nodes: 3 Number of AST nodes: 2
1
if ( loadContexts == null ) {
1
if ( 
2
			loadContexts = new Load
2
extendedJTATransaction == null ) {
3
Contexts( this );
3
						extendedJTATransaction = NamingHelper.getInitialContext( props )
4
		}
4
		
5
		return loadContexts;
5
						.lookup( "java:comp/websphere/ExtendedJTATransaction" );
6
					}
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.1
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (loadContexts == null)
    1
    if (loadContexts == null)
    2
    if (extendedJTATransaction == null)
    Differences
    Expression1Expression2Difference
    loadContextsextendedJTATransactionVARIABLE_NAME_MISMATCH
    org.hibernate.engine.loading.LoadContextsjava.lang.ObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.engine.loading.LoadContexts of variable loadContexts does not match with type java.lang.Object of variable extendedJTATransaction
    • Make classes org.hibernate.engine.loading.LoadContexts and java.lang.Object extend a common superclass
    2
    if (extendedJTATransaction == null)
    2
    loadContexts = new LoadContexts(this);
                                                                                  
                                                                                                                                                                                                                                              
    3
    extendedJTATransaction = NamingHelper.getInitialContext(props).lookup("java:comp/websphere/ExtendedJTATransaction");
    3
    return loadContexts;
    3
    return loadContexts;
    Preondition Violations
    Unmatched return loadContexts;
                                                  
    Precondition Violations (2)
    Row Violation
    1Type org.hibernate.engine.loading.LoadContexts of variable loadContexts does not match with type java.lang.Object of variable extendedJTATransaction
    2Unmatched return loadContexts;