File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/util/DualNodeJtaTransactionManagerImpl.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/stat/StatisticsImpl.java | |||
Method name: DualNodeJtaTransactionManagerImpl getInstance(String)
|
Method name: EntityStatistics getEntityStatistics(String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | DualNodeJtaTransactionManagerImpl tm = (DualNodeJtaTransactionManagerImpl) INSTANCES.get(nodeId);↵ | |||
2 | ↵ | 1 | EntityStatistics es = (EntityStatistics) entityStatistics.get(entityName);↵ | |
3 | if (tm == null) {↵ | 2 | if (es==null) {↵ | |
4 | tm = new DualNodeJtaTransactionManagerImpl(nodeId);↵ | 3 | ↵ | |
5 | INSTANCES.put(nodeId, tm);↵ | |||
6 | ↵ | 4 | es = new EntityStatistics(entityName);↵ | |
5 | entityStatistics.put(entityName, es);↵ | |||
7 | }↵ | 6 | }↵ | |
8 | return tm; | 7 | return es; | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | EntityStatistics es = (EntityStatistics)entityStatistics.get(entityName); | |||||||||||||||||||||||||
1 | DualNodeJtaTransactionManagerImpl tm = (DualNodeJtaTransactionManagerImpl)INSTANCES.get(nodeId); | | |||||||||||||||||||||||||
2 | if (tm == null) |
| 2 | if (es == null) | |||||||||||||||||||||||
|
| 3 | es = new EntityStatistics(entityName); | ||||||||||||||||||||||||
3 | tm = new DualNodeJtaTransactionManagerImpl(nodeId); |
| | ||||||||||||||||||||||||
4 | INSTANCES.put(nodeId, tm); |
| 4 | entityStatistics.put(entityName, es); | |||||||||||||||||||||||
|
| 5 | return es; | ||||||||||||||||||||||||
5 | return tm; |
| |
Row | Violation |
---|---|
1 | Type org.hibernate.test.cache.jbc2.functional.util.DualNodeJtaTransactionManagerImpl of variable tm does not match with type org.hibernate.stat.EntityStatistics of variable es |
2 | Unmatched statement es=new EntityStatistics(entityName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement tm=new DualNodeJtaTransactionManagerImpl(nodeId); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Type org.hibernate.test.cache.jbc2.functional.util.DualNodeJtaTransactionManagerImpl of variable tm does not match with type org.hibernate.stat.EntityStatistics of variable es |
5 | Unmatched return es; |
6 | Unmatched return tm; |
7 | The refactoring of the clones is infeasible, because classes org.hibernate.test.cache.jbc2.functional.util.DualNodeJtaTransactionManagerImpl and org.hibernate.stat.StatisticsImpl do not have a common superclass |