File path: /jruby-1.4.0/src/org/jruby/util/NormalizedFile.java | File path: /jruby-1.4.0/src/org/jruby/javasupport/proxy/JavaProxyClassFactory.java | |||
Method name: String[] list(FilenameFilter)
|
Method name: Type[] getType(Class[])
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | String[] smartFiles = new String[files.length];↵ | 1 | Type[] result = new Type[parameterTypes.length];↵ | |
2 | for (int i = 0; i < files.length; i++) {↵ | 2 | for (int i = 0; i < parameterTypes.length; i++) {↵ | |
3 | smartFiles[i] = files[i].replace(File.separatorChar, '/');↵ | 3 | result[i] = Type.getType(parameterTypes[i]);↵ | |
4 | }↵ | 4 | }↵ | |
5 | return smartFiles; | 5 | return result; | |
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) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Type[] result = new Type[parameterTypes.length]; | ||||||||||||||||
4 | String[] smartFiles = new String[files.length]; | | ||||||||||||||||
5 | for (int i = 0; i < files.length; i++) |
| 2 | for (int i = 0; i < parameterTypes.length; i++) | ||||||||||||||
|
| 3 | result[i] = Type.getType(parameterTypes[i]); | |||||||||||||||
6 | smartFiles[i] = files[i].replace(File.separatorChar, '/'); |
| | |||||||||||||||
|
| 4 | return result; | |||||||||||||||
7 | return smartFiles; |
| |
Row | Violation |
---|---|
1 | Type java.lang.String[] of variable files does not match with type java.lang.Class[] of variable parameterTypes |
2 | Unmatched statement result[i]=Type.getType(parameterTypes[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement smartFiles[i]=files[i].replace(File.separatorChar,'/'); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return result; |
5 | Unmatched return smartFiles; |