CollectionStatistics cs = (CollectionStatistics) collectionStatistics.get(role); if (cs==null) { cs = new CollectionStatistics(role); collectionStatistics.put(role, cs); } return cs;
EntityStatistics es = (EntityStatistics) entityStatistics.get(entityName); if (es==null) { es = new EntityStatistics(entityName); entityStatistics.put(entityName, es); } return es;
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: CollectionStatistics getCollectionStatistics(String) Method name: EntityStatistics getEntityStatistics(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
CollectionStatistics cs = (CollectionStatistics) collectionStatistics.get(role);
1
EntityStatistics es = (EntityStatistics) entityStatistics.get(entityName);
2
		if (cs==null) {
2
		if (es==null) {
3
			cs = new CollectionStatistics(role);
3
			es = new EntityStatistics(
4
			collection
4
entityName);
5
Statistics.put(role, cs);
5
			entityStatistics.put(entityName, es);
6
		}
6
		}
7
		return cs;
7
		return es;
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)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    CollectionStatistics cs = (CollectionStatistics)collectionStatistics.get(role);
    1
    CollectionStatistics cs = (CollectionStatistics)collectionStatistics.get(role);
    1
    EntityStatistics es = (EntityStatistics)entityStatistics.get(entityName);
    Differences
    Expression1Expression2Difference
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.EntityStatisticsSUBCLASS_TYPE_MISMATCH
    csesVARIABLE_NAME_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.EntityStatisticsSUBCLASS_TYPE_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.EntityStatisticsSUBCLASS_TYPE_MISMATCH
    roleentityNameVARIABLE_NAME_MISMATCH
    collectionStatisticsentityStatisticsVARIABLE_NAME_MISMATCH
    1
    EntityStatistics es = (EntityStatistics)entityStatistics.get(entityName);
    2
    if (cs == null)
    2
    if (cs == null)
    2
    if (es == null)
    Differences
    Expression1Expression2Difference
    csesVARIABLE_NAME_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.EntityStatisticsSUBCLASS_TYPE_MISMATCH
    2
    if (es == null)
    3
    cs = new CollectionStatistics(role);
    3
    cs = new CollectionStatistics(role);
    3
    es = new EntityStatistics(entityName);
    Differences
    Expression1Expression2Difference
    csesVARIABLE_NAME_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.EntityStatisticsSUBCLASS_TYPE_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.EntityStatisticsSUBCLASS_TYPE_MISMATCH
    roleentityNameVARIABLE_NAME_MISMATCH
    3
    es = new EntityStatistics(entityName);
    4
    collectionStatistics.put(role, cs);
    4
    collectionStatistics.put(role, cs);
    4
    entityStatistics.put(entityName, es);
    Differences
    Expression1Expression2Difference
    roleentityNameVARIABLE_NAME_MISMATCH
    csesVARIABLE_NAME_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.EntityStatisticsSUBCLASS_TYPE_MISMATCH
    collectionStatisticsentityStatisticsVARIABLE_NAME_MISMATCH
    4
    entityStatistics.put(entityName, es);
    5
    return cs;
    5
    return cs;
    5
    return es;
    Differences
    Expression1Expression2Difference
    csesVARIABLE_NAME_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.EntityStatisticsSUBCLASS_TYPE_MISMATCH
    5
    return es;
    Precondition Violations (0)
    Row Violation