if (result==null) { // in case we were deserialized in a different JVM, look for an instance with the same name // (alternatively we could do an actual JNDI lookup here....) result = SessionFactoryObjectFactory.getNamedInstance(name); if (result==null) { throw new InvalidObjectException("Could not find a SessionFactory named: " + name); } else { log.debug("resolved SessionFactory by name"); } } else { log.debug("resolved SessionFactory by uid"); }
if (result==null) { // in case we were deserialized in a different JVM, look for an instance with the same name // (alternatively we could do an actual JNDI lookup here....) result = SessionFactoryObjectFactory.getNamedInstance(name); if (result==null) { throw new InvalidObjectException("Could not find a stub SessionFactory named: " + name); } else { log.debug("resolved stub SessionFactory by name"); } } else { log.debug("resolved stub SessionFactory by uid"); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java File path: /hibernate-distribution-3.3.2.GA/project/jmx/src/main/java/org/hibernate/jmx/SessionFactoryStub.java
Method name: Object readResolve() Method name: Object readResolve()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (result==null) {
1
if (result==null) {
2
			// in case we were deserialized in a different JVM, look for an instance with the same name
2
			// in case we were deserialized in a different JVM, look for an instance with the same name
3
			// (alternatively we could do an actual JNDI lookup here....)
3
			// (alternatively we could do an actual JNDI lookup here....)
4
			result = SessionFactoryObjectFactory.getNamedInstance(name);
4
			result = SessionFactoryObjectFactory.getNamedInstance(name);
5
			if (result==null) {
5
			if (result==null) {
6
				throw new InvalidObjectException("Could not find a SessionFactory named: " + name);
6
				throw new InvalidObjectException("Could not find a stub SessionFactory named: " + name);
7
			}
7
			}
8
			else {
8
			else {
9
				log.debug("resolved SessionFactory by name");
9
				log.debug("resolved stub SessionFactory by name");
10
			}
10
			}
11
		}
11
		}
12
		else {
12
		else {
13
			log.debug("resolved SessionFactory by uid");
13
			log.debug("resolved stub SessionFactory by uid");
14
		}
14
		}
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.2
Clones locationClones are in different classes
Number of node comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (result == null)
    2
    if (result == null)
    4
    result = SessionFactoryObjectFactory.getNamedInstance(name);
    3
    result = SessionFactoryObjectFactory.getNamedInstance(name);
    5
    if (result == null)
    4
    if (result == null)
    6
    throw new InvalidObjectException("Could not find a SessionFactory named: " + name);
    6
    throw new InvalidObjectException("Could not find a SessionFactory named: " + name);
    5
    throw new InvalidObjectException("Could not find a stub SessionFactory named: " + name);
    Differences
    Expression1Expression2Difference
    "Could not find a SessionFactory named: ""Could not find a stub SessionFactory named: "LITERAL_VALUE_MISMATCH
    5
    throw new InvalidObjectException("Could not find a stub SessionFactory named: " + name);
    else
    else
    7
    log.debug("resolved SessionFactory by name");
    7
    log.debug("resolved SessionFactory by name");
    6
    log.debug("resolved stub SessionFactory by name");
    Differences
    Expression1Expression2Difference
    "resolved SessionFactory by name""resolved stub SessionFactory by name"LITERAL_VALUE_MISMATCH
    6
    log.debug("resolved stub SessionFactory by name");
    else
    else
    8
    log.debug("resolved SessionFactory by uid");
    8
    log.debug("resolved SessionFactory by uid");
    7
    log.debug("resolved stub SessionFactory by uid");
    Differences
    Expression1Expression2Difference
    "resolved SessionFactory by uid""resolved stub SessionFactory by uid"LITERAL_VALUE_MISMATCH
    7
    log.debug("resolved stub SessionFactory by uid");
    Precondition Violations (0)
    Row Violation