EntityStatistics es = (EntityStatistics) entityStatistics.get(entityName); if (es==null) { es = new EntityStatistics(entityName); entityStatistics.put(entityName, es); } return es;
CollectionStatistics cs = (CollectionStatistics) collectionStatistics.get(role); if (cs==null) { cs = new CollectionStatistics(role); collectionStatistics.put(role, cs); } return cs;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/stat/StatisticsImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/stat/StatisticsImpl.java
Method name: EntityStatistics getEntityStatistics(String) Method name: CollectionStatistics getCollectionStatistics(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
EntityStatistics es = (EntityStatistics) entityStatistics.get(entityName);
1
CollectionStatistics cs = (CollectionStatistics) collectionStatistics.get(role);
2
		if (es==null) {
2
		if (cs==null) {
3
			es = new EntityStatistics(entityName);
3
			cs = new CollectionStatistics(
4
			entity
4
role);
5
Statistics.put(entityName, es);
5
			collectionStatistics.put(role, cs);
6
		}
6
		}
7
		return es;
7
		return cs;
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.1
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    EntityStatistics es = (EntityStatistics)entityStatistics.get(entityName);
    1
    EntityStatistics es = (EntityStatistics)entityStatistics.get(entityName);
    1
    CollectionStatistics cs = (CollectionStatistics)collectionStatistics.get(role);
    Differences
    Expression1Expression2Difference
    org.hibernate.stat.EntityStatisticsorg.hibernate.stat.CollectionStatisticsSUBCLASS_TYPE_MISMATCH
    escsVARIABLE_NAME_MISMATCH
    org.hibernate.stat.EntityStatisticsorg.hibernate.stat.CollectionStatisticsSUBCLASS_TYPE_MISMATCH
    org.hibernate.stat.EntityStatisticsorg.hibernate.stat.CollectionStatisticsSUBCLASS_TYPE_MISMATCH
    entityNameroleVARIABLE_NAME_MISMATCH
    entityStatisticscollectionStatisticsVARIABLE_NAME_MISMATCH
    1
    CollectionStatistics cs = (CollectionStatistics)collectionStatistics.get(role);
    2
    if (es == null)
    2
    if (es == null)
    2
    if (cs == null)
    Differences
    Expression1Expression2Difference
    escsVARIABLE_NAME_MISMATCH
    org.hibernate.stat.EntityStatisticsorg.hibernate.stat.CollectionStatisticsSUBCLASS_TYPE_MISMATCH
    2
    if (cs == null)
    3
    es = new EntityStatistics(entityName);
    3
    es = new EntityStatistics(entityName);
    3
    cs = new CollectionStatistics(role);
    Differences
    Expression1Expression2Difference
    escsVARIABLE_NAME_MISMATCH
    org.hibernate.stat.EntityStatisticsorg.hibernate.stat.CollectionStatisticsSUBCLASS_TYPE_MISMATCH
    org.hibernate.stat.EntityStatisticsorg.hibernate.stat.CollectionStatisticsSUBCLASS_TYPE_MISMATCH
    entityNameroleVARIABLE_NAME_MISMATCH
    3
    cs = new CollectionStatistics(role);
    4
    entityStatistics.put(entityName, es);
    4
    entityStatistics.put(entityName, es);
    4
    collectionStatistics.put(role, cs);
    Differences
    Expression1Expression2Difference
    entityNameroleVARIABLE_NAME_MISMATCH
    escsVARIABLE_NAME_MISMATCH
    org.hibernate.stat.EntityStatisticsorg.hibernate.stat.CollectionStatisticsSUBCLASS_TYPE_MISMATCH
    entityStatisticscollectionStatisticsVARIABLE_NAME_MISMATCH
    4
    collectionStatistics.put(role, cs);
    5
    return es;
    5
    return es;
    5
    return cs;
    Differences
    Expression1Expression2Difference
    escsVARIABLE_NAME_MISMATCH
    org.hibernate.stat.EntityStatisticsorg.hibernate.stat.CollectionStatisticsSUBCLASS_TYPE_MISMATCH
    5
    return cs;
    Precondition Violations (0)
    Row Violation