File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/query/ParamLocationRecognizer.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/stat/StatisticsImpl.java | |||
Method name: NamedParameterDescription getOrBuildNamedParameterDescription(String, boolean)
|
Method name: CollectionStatistics getCollectionStatistics(String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | NamedParameterDescription desc = ( NamedParameterDescription ) namedParameterDescriptions.get( name );↵ | 1 | CollectionStatistics cs = (CollectionStatistics) collectionStatistics.get(role);↵ | |
2 | if ( desc == null ) {↵ | 2 | if (cs==null) {↵ | |
3 | desc = new NamedParameterDescription( jpa );↵ | 3 | cs = new ↵ | |
4 | namedParameterDescription↵ | 4 | CollectionStatistics(role);↵ | |
5 | s.put( name, desc );↵ | 5 | collectionStatistics.put(role, cs);↵ | |
6 | }↵ | 6 | }↵ | |
7 | return desc; | 7 | return cs; | |
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) | 0.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | CollectionStatistics cs = (CollectionStatistics)collectionStatistics.get(role); | ||||||||||||||||||||||
1 | NamedParameterDescription desc = (NamedParameterDescription)namedParameterDescriptions.get(name); | | ||||||||||||||||||||||
2 | if (desc == null) |
| 2 | if (cs == null) | ||||||||||||||||||||
|
| 3 | cs = new CollectionStatistics(role); | |||||||||||||||||||||
3 | desc = new NamedParameterDescription(jpa); |
| | |||||||||||||||||||||
4 | namedParameterDescriptions.put(name, desc); |
| 4 | collectionStatistics.put(role, cs); | ||||||||||||||||||||
|
| 5 | return cs; | |||||||||||||||||||||
5 | return desc; |
| |
Row | Violation |
---|---|
1 | Type org.hibernate.engine.query.ParamLocationRecognizer.NamedParameterDescription of variable desc does not match with type org.hibernate.stat.CollectionStatistics of variable cs |
2 | Unmatched statement cs=new CollectionStatistics(role); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement desc=new NamedParameterDescription(jpa); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Type org.hibernate.engine.query.ParamLocationRecognizer.NamedParameterDescription of variable desc does not match with type org.hibernate.stat.CollectionStatistics of variable cs |
5 | Unmatched return cs; |
6 | Unmatched return desc; |