File path: /jEdit-4.2/src/bsh/ClassGeneratorUtil.java | File path: /jEdit-4.2/src/bsh/Primitive.java | |||
Method name: String[] getTypeDescriptors(Class[])
|
Method name: Object[] unwrap(Object[])
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | String [] sa = new String [cparams.length];↵ | 1 | Object [] oa = new Object[ args.length ];↵ | |
2 | for(int i=0; i<sa.length; i++)↵ | 2 | for(int i=0; i<args.length; i++)↵ | |
3 | sa[i] = BSHType.getTypeDescriptor( cparams[i] );↵ | 3 | oa[i] = unwrap( args[i] );↵ | |
4 | return sa; | 4 | return oa; | |
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 | 8 |
Number of mapped statements | 1 |
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.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Object[] oa = new Object[args.length]; | ||||||||||||||||
1 | String[] sa = new String[cparams.length]; | | ||||||||||||||||
2 | for (int i = 0; i < sa.length; i++) |
| 2 | for (int i = 0; i < args.length; i++) | ||||||||||||||
|
| 3 | oa[i] = unwrap(args[i]); | |||||||||||||||
3 | sa[i] = BSHType.getTypeDescriptor(cparams[i]); |
| | |||||||||||||||
|
| 4 | return oa; | |||||||||||||||
4 | return sa; |
| |
Row | Violation |
---|---|
1 | Type int of variable sa.length does not match with type int of variable args.length |
2 | Unmatched statement oa[i]=unwrap(args[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement sa[i]=BSHType.getTypeDescriptor(cparams[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return oa; |
5 | Unmatched return sa; |
6 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |