File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/Loader.java | File path: /hibernate-distribution-3.3.2.GA/project/testing/src/main/java/org/hibernate/junit/functional/FunctionalTestCase.java | |||
Method name: boolean hasSubselectLoadableCollections()
|
Method name: boolean dialectIsOneOf(Class[])
|
|||
Number of AST nodes: 5 | Number of AST nodes: 4 | |||
1 | final Loadable[] loadables = getEntityPersisters();↵ | |||
2 | for (int i=0; i<loadables.length; i++ ) {↵ | 1 | for ( int i = 0; i < dialectClasses.length; i++ ) { ↵ | |
3 | if ( loadables[i].hasSubselectLoadableCollections() ) ↵ | 2 | if ( dialectClasses[i].isInstance( getDialect() ) ) {↵ | |
4 | return true;↵ | 3 | return true;↵ | |
4 | } ↵ | |||
5 | }↵ | 5 | } ↵ | |
6 | return false; | 6 |
| |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 4 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final Loadable[] loadables = getEntityPersisters(); | | ||||||||||||||||
2 | for (int i = 0; i < loadables.length; i++) |
| 1 | for (int i = 0; i < dialectClasses.length; i++) | ||||||||||||||
|
| 2 | if (dialectClasses[i].isInstance(getDialect())) | |||||||||||||||
|
| 3 | return true; | |||||||||||||||
3 | if (loadables[i].hasSubselectLoadableCollections()) |
| | |||||||||||||||
4 | return true; |
| | |||||||||||||||
5 | return false; | 4 | return false; |
Row | Violation |
---|---|
1 | Type int of variable loadables.length does not match with type int of variable dialectClasses.length |
2 | Unmatched statement if(dialectClasses[i].isInstance(getDialect())) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched return true; |
4 | Unmatched statement if(loadables[i].hasSubselectLoadableCollections()) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched return true; |