File path: /jEdit-4.2/src/bsh/NameSpace.java | File path: /jEdit-4.2/src/bsh/NameSpace.java | |||
Method name: void importPackage(String)
|
Method name: void importStatic(Class)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if(importedPackages == null)↵ | 1 | if ( importedStatic == null )↵ | |
2 | importedPackages = new Vector();↵ | 2 | importedStatic = new Vector();↵ | |
3 | // If it exists, remove it and add it at the end (avoid memory leak)↵ | 3 | // If it exists, remove it and add it at the end (avoid memory leak)↵ | |
4 | if ( importedPackages.contains( name ) )↵ | 4 | if ( importedStatic.contains( clas ) )↵ | |
5 | importedPackages.remove( name );↵ | 5 | importedStatic.remove( clas );↵ | |
6 | importedPackages.addElement(name);↵ | 6 | importedStatic.addElement( clas );↵ | |
7 | nameSpaceChanged(); | 7 |
| |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (importedPackages == null) |
| 1 | if (importedStatic == null) | |||||||||||||||||||
2 | importedPackages = new Vector(); |
| 2 | importedStatic = new Vector(); | |||||||||||||||||||
3 | if (importedPackages.contains(name)) |
| 3 | if (importedStatic.contains(clas)) | |||||||||||||||||||
4 | importedPackages.remove(name); |
| 4 | importedStatic.remove(clas); | |||||||||||||||||||
5 | importedPackages.addElement(name); |
| 5 | importedStatic.addElement(clas); | |||||||||||||||||||
6 | nameSpaceChanged(); | 6 | nameSpaceChanged(); |
Row | Violation |
---|---|
1 | Expression importedPackages is a field being modified, and thus it cannot be parameterized |
2 | Expression importedStatic is a field being modified, and thus it cannot be parameterized |
3 | Type java.lang.String of variable name does not match with type java.lang.Class of variable clas |
4 | Expression importedPackages cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression importedStatic cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type java.lang.String of variable name does not match with type java.lang.Class of variable clas |
7 | Expression importedPackages cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression importedStatic cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Type java.lang.String of variable name does not match with type java.lang.Class of variable clas |
10 | Expression importedPackages cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression importedStatic cannot be parameterized, because it has dependencies to/from statements that will be extracted |