File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/javassist/FastClass.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/javassist/FastClass.java | |||
Method name: int getIndex(String, Class[])
|
Method name: int getIndex(Class[])
|
|||
Number of AST nodes: 14 | Number of AST nodes: 13 | |||
1 | for ( int i = 0; i < conss.length; ++i ) {↵ | |||
1 | if ( !Modifier.isPublic( methods[i].getModifiers() ) ) {↵ | 2 | if ( !Modifier.isPublic( conss[i].getModifiers() ) ) {↵ | |
2 | continue;↵ | 3 | continue;↵ | |
3 | }↵ | 4 | }↵ | |
4 | if ( !methods[i].getName().equals( name ) ) {↵ | 5 | ↵ | |
5 | continue;↵ | |||
6 | }↵ | |||
7 | Class[] params = methods[i].getParameterTypes();↵ | 6 | Class[] params = conss[i].getParameterTypes();↵ | |
8 | if ( params.length != parameterTypes.length ) {↵ | 7 | if ( params.length != parameterTypes.length ) {↵ | |
9 | continue;↵ | 8 | continue;↵ | |
10 | }↵ | 9 | }↵ | |
11 | eq = true;↵ | 10 | eq = true;↵ | |
12 | for ( int j = 0; j < params.length; ++j ) {↵ | 11 | for ( int j = 0; j < params.length; ++j ) {↵ | |
13 | if ( !params[j].equals( parameterTypes[j] ) ) {↵ | 12 | if ( !params[j].equals( parameterTypes[j] ) ) {↵ | |
14 | eq = false;↵ | 13 | eq = false;↵ | |
15 | break;↵ | 14 | break;↵ | |
16 | }↵ | 15 | }↵ | |
17 | }↵ | 16 | }↵ | |
18 | if ( eq ) {↵ | 17 | if ( eq ) {↵ | |
19 | return i;↵ | 18 | return i;↵ | |
20 | } | 19 | }↵ | |
20 |
| |||
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) | 1.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 50 |
Number of mapped statements | 9 |
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.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
|
| 6 | Class[] params = conss[i].getParameterTypes(); | ||||
6 | if (!methods[i].getName().equals(name)) | | |||||
8 | Class[] params = methods[i].getParameterTypes(); |
| | ||||
9 | if (params.length != parameterTypes.length) | 7 | if (params.length != parameterTypes.length) | ||||
10 | continue; |
| | ||||
11 | eq = true; | 9 | eq = true; | ||||
12 | for (int j = 0; j < params.length; ++j) | 10 | for (int j = 0; j < params.length; ++j) | ||||
|
| 14 | if (eq) | ||||
|
| 15 | return i; |
Row | Violation |
---|---|
1 | Unmatched statement Class[] params=conss[i].getParameterTypes(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement Class[] params=methods[i].getParameterTypes(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched continue; |
4 | Unmatched statement if(eq) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched return i; |