File path: /jEdit-4.2/src/bsh/BSHFormalParameters.java | File path: /jEdit-4.2/src/bsh/BSHFormalParameters.java | |||
Method name: Object eval(CallStack, Interpreter)
|
Method name: String[] getTypeDescriptors(CallStack, Interpreter, String)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | if ( paramTypes != null )↵ | 1 | if ( typeDescriptors != null )↵ | |
2 | return paramTypes;↵ | 2 | return typeDescriptors;↵ | |
3 | insureParsed();↵ | 3 | insureParsed();↵ | |
4 | Class [] paramTypes = new Class[numArgs];↵ | 4 | String [] typeDesc = new String[numArgs];↵ | |
5 | for(int i=0; i<numArgs; i++)↵ | 5 | for(int i=0; i<numArgs; i++)↵ | |
6 | {↵ | 6 | {↵ | |
7 | BSHFormalParameter param = (BSHFormalParameter)jjtGetChild(i);↵ | 7 | BSHFormalParameter param = (BSHFormalParameter)jjtGetChild(i);↵ | |
8 | paramTypes[i] = (Class)param.eval( ↵ | 8 | typeDesc[i] = param.getTypeDescriptor( ↵ | |
9 | callstack, interpreter );↵ | 9 | callstack, interpreter↵ | |
10 | }↵ | |||
11 | this.paramTypes = paramTypes;↵ | |||
10 | , defaultPackage );↵ | |||
11 | }↵ | |||
12 | this.typeDescriptors = typeDesc;↵ | |||
12 | return paramTypes; | 13 | return typeDesc; | |
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 31 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 2.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (paramTypes != null) |
| 1 | if (typeDescriptors != null) | ||||||||||||||
|
| 2 | return typeDescriptors; | |||||||||||||||
2 | return paramTypes; |
| | |||||||||||||||
3 | insureParsed(); | 3 | insureParsed(); | |||||||||||||||
| 4 | String[] typeDesc = new String[numArgs]; | ||||||||||||||||
4 | Class[] paramTypes = new Class[numArgs]; | | ||||||||||||||||
5 | for (int i = 0; i < numArgs; i++) | 5 | for (int i = 0; i < numArgs; i++) | |||||||||||||||
6 | BSHFormalParameter param = (BSHFormalParameter)jjtGetChild(i); | 6 | BSHFormalParameter param = (BSHFormalParameter)jjtGetChild(i); | |||||||||||||||
|
| 7 | typeDesc[i] = param.getTypeDescriptor(callstack, interpreter, defaultPackage); | |||||||||||||||
7 | paramTypes[i] = (Class)param.eval(callstack, interpreter); |
| | |||||||||||||||
| 8 | this.typeDescriptors = typeDesc; | ||||||||||||||||
8 | this.paramTypes = paramTypes; | | ||||||||||||||||
|
| 9 | return typeDesc; | |||||||||||||||
9 | return paramTypes; |
| |
Row | Violation |
---|---|
1 | Type java.lang.Class[] of variable paramTypes does not match with type java.lang.String[] of variable typeDescriptors |
2 | Unmatched return typeDescriptors; |
3 | Unmatched return paramTypes; |
4 | Unmatched statement typeDesc[i]=param.getTypeDescriptor(callstack,interpreter,defaultPackage); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement paramTypes[i]=(Class)param.eval(callstack,interpreter); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched return typeDesc; |
7 | Unmatched return paramTypes; |
8 | Clone fragment #1 returns variables i, param , while Clone fragment #2 returns variables i, param |