CollectionStatistics cs = (CollectionStatistics) collectionStatistics.get(role); if (cs==null) { cs = new CollectionStatistics(role); collectionStatistics.put(role, cs); } return cs;
QueryStatistics qs = (QueryStatistics) queryStatistics.get(queryString); if (qs==null) { qs = new QueryStatistics(queryString); queryStatistics.put(queryString, qs); } return qs;
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: QueryStatistics getQueryStatistics(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
CollectionStatistics cs = (CollectionStatistics) collectionStatistics.get(role);
1
QueryStatistics qs = (QueryStatistics) queryStatistics.get(queryString);
2
		if (cs==null) {
2
		if (qs==null) {
3
			cs = new CollectionStatistics(role);
3
			qs = new QueryStatistics(
4
			collection
4
queryString);
5
Statistics.put(role, cs);
5
			queryStatistics.put(queryString, qs);
6
		}
6
		}
7
		return cs;
7
		return qs;
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 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)7.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    CollectionStatistics cs = (CollectionStatistics)collectionStatistics.get(role);
    1
    CollectionStatistics cs = (CollectionStatistics)collectionStatistics.get(role);
    1
    QueryStatistics qs = (QueryStatistics)queryStatistics.get(queryString);
    Differences
    Expression1Expression2Difference
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.QueryStatisticsSUBCLASS_TYPE_MISMATCH
    csqsVARIABLE_NAME_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.QueryStatisticsSUBCLASS_TYPE_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.QueryStatisticsSUBCLASS_TYPE_MISMATCH
    rolequeryStringVARIABLE_NAME_MISMATCH
    collectionStatisticsqueryStatisticsVARIABLE_NAME_MISMATCH
    1
    QueryStatistics qs = (QueryStatistics)queryStatistics.get(queryString);
    2
    if (cs == null)
    2
    if (cs == null)
    2
    if (qs == null)
    Differences
    Expression1Expression2Difference
    csqsVARIABLE_NAME_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.QueryStatisticsSUBCLASS_TYPE_MISMATCH
    2
    if (qs == null)
    3
    cs = new CollectionStatistics(role);
    3
    cs = new CollectionStatistics(role);
    3
    qs = new QueryStatistics(queryString);
    Differences
    Expression1Expression2Difference
    csqsVARIABLE_NAME_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.QueryStatisticsSUBCLASS_TYPE_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.QueryStatisticsSUBCLASS_TYPE_MISMATCH
    rolequeryStringVARIABLE_NAME_MISMATCH
    3
    qs = new QueryStatistics(queryString);
    4
    collectionStatistics.put(role, cs);
    4
    collectionStatistics.put(role, cs);
    4
    queryStatistics.put(queryString, qs);
    Differences
    Expression1Expression2Difference
    rolequeryStringVARIABLE_NAME_MISMATCH
    csqsVARIABLE_NAME_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.QueryStatisticsSUBCLASS_TYPE_MISMATCH
    collectionStatisticsqueryStatisticsVARIABLE_NAME_MISMATCH
    4
    queryStatistics.put(queryString, qs);
    5
    return cs;
    5
    return cs;
    5
    return qs;
    Differences
    Expression1Expression2Difference
    csqsVARIABLE_NAME_MISMATCH
    org.hibernate.stat.CollectionStatisticsorg.hibernate.stat.QueryStatisticsSUBCLASS_TYPE_MISMATCH
    5
    return qs;
    Precondition Violations (0)
    Row Violation