File path: /jEdit-4.2/src/bsh/ClassGenerator.java | File path: /jEdit-4.2/src/bsh/ReflectManager.java | |||
Method name: ClassGenerator getClassGenerator()
|
Method name: ReflectManager getReflectManager()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 6 | |||
1 | if ( cg == null ) ↵ | 1 | if ( rfm == null ) ↵ | |
2 | {↵ | 2 | {↵ | |
3 | ↵ | 3 | Class clas;↵ | |
4 | try {↵ | 4 | try {↵ | |
5 | Class clas = Class.forName( "bsh.ClassGeneratorImpl" );↵ | 5 | clas = Class.forName( "bsh.reflect.ReflectManagerImpl" );↵ | |
6 | cg = (ClassGenerator)clas.newInstance();↵ | 6 | rfm = (ReflectManager)clas.newInstance();↵ | |
7 | } catch ( Exception e ) {↵ | 7 | } catch ( Exception e ) {↵ | |
8 | throw new Unavailable("ClassGenerator unavailable: "+e);↵ | 8 | throw new Unavailable("Reflect Manager unavailable: "+e);↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | ↵ | 11 | ↵ | |
12 | return cg; | 12 | return rfm; | |
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 | 12 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (cg == null) |
| 1 | if (rfm == null) | ||||||||||||||
| 2 | Class clas; | ||||||||||||||||
2 | try |
| 3 | try | ||||||||||||||
3 | Class clas = Class.forName("bsh.ClassGeneratorImpl"); |
| | |||||||||||||||
|
| 4 | clas = Class.forName("bsh.reflect.ReflectManagerImpl"); | |||||||||||||||
4 | cg = (ClassGenerator)clas.newInstance(); |
| | |||||||||||||||
|
| 5 | rfm = (ReflectManager)clas.newInstance(); | |||||||||||||||
5 | return cg; |
| | |||||||||||||||
|
| 6 | return rfm; |
Row | Violation |
---|---|
1 | Type bsh.ClassGenerator of variable cg does not match with type bsh.ReflectManager of variable rfm |
2 | Unmatched statement Class clas=Class.forName("bsh.ClassGeneratorImpl"); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched statement clas=Class.forName("bsh.reflect.ReflectManagerImpl"); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | Unmatched statement cg=(ClassGenerator)clas.newInstance(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
5 | Unmatched statement rfm=(ReflectManager)clas.newInstance(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
6 | Unmatched return cg; |
7 | Unmatched return rfm; |