File path: /jEdit-4.2/src/bsh/Primitive.java | File path: /jEdit-4.2/src/bsh/NameSpace.java | |||
Method name: Class unboxType(Class)
|
Method name: InputStream getCommand(String)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | Class c = (Class)wrapperToPrimitive.get( wrapperType ↵ | 1 | CommandPathEntry entry = (CommandPathEntry)importedCommands↵ | |
2 | .elementAt(i);↵ | |||
2 | );↵ | 3 | InputStream in = entry.clas.getResourceAsStream(entry.path + extName);↵ | |
3 | if ( c != null )↵ | 4 | if(in != null)↵ | |
4 | return c;↵ | 5 | ↵ | |
5 | throw new InterpreterError( ↵ | |||
6 | "Not a primitive wrapper type: "+wrapperType ); | 6 | return in; | |
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.1 |
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 | Class c = (Class)wrapperToPrimitive.get(wrapperType); | | ||||||||||||||||
| 4 | CommandPathEntry entry = (CommandPathEntry)importedCommands.elementAt(i); | ||||||||||||||||
|
| 5 | InputStream in = entry.clas.getResourceAsStream(entry.path + extName); | |||||||||||||||
2 | if (c != null) |
| 6 | if (in != null) | ||||||||||||||
3 | return c; |
| | |||||||||||||||
|
| 7 | return in; | |||||||||||||||
4 | throw new InterpreterError("Not a primitive wrapper type: " + wrapperType); |
| |
Row | Violation |
---|---|
1 | Unmatched statement InputStream in=entry.clas.getResourceAsStream(entry.path + extName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type java.lang.Class of variable c does not match with type java.io.InputStream of variable in |
3 | Unmatched return c; |
4 | Unmatched return in; |
5 | Unmatched throw new InterpreterError("Not a primitive wrapper type: " + wrapperType); |