File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/EnhancedDialog.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/EnhancedDialog.java | |||
Method name: void componentAdded(Component)
|
Method name: void componentRemoved(Component)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | Container cont = (Container)comp;↵ | 1 | Container cont = (Container)comp;↵ | |
2 | cont.addContainerListener(this);↵ | 2 | cont.removeContainerListener(this);↵ | |
3 | Component[] comps = cont.getComponents();↵ | 3 | Component[] comps = cont.getComponents();↵ | |
4 | for(int i = 0; i < comps.length; i++)↵ | 4 | for(int i = 0; i < comps.length; i++)↵ | |
5 | {↵ | 5 | {↵ | |
6 | componentAdded(comps[i]);↵ | 6 | componentRemoved(comps[i]);↵ | |
7 | } | 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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
Number of mapped statements | 5 |
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) | 1.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | Container cont = (Container)comp; | 3 | Container cont = (Container)comp; | |||||||||||||||
4 | cont.addContainerListener(this); |
| 4 | cont.removeContainerListener(this); | ||||||||||||||
5 | Component[] comps = cont.getComponents(); | 5 | Component[] comps = cont.getComponents(); | |||||||||||||||
6 | for (int i = 0; i < comps.length; i++) | 6 | for (int i = 0; i < comps.length; i++) | |||||||||||||||
7 | componentAdded(comps[i]); |
| 7 | componentRemoved(comps[i]); |
Row | Violation |
---|---|
1 | Expression cont.addContainerListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression cont.removeContainerListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression cont.addContainerListener(this) is a void method call, and thus it cannot be parameterized |
4 | Expression cont.removeContainerListener(this) is a void method call, and thus it cannot be parameterized |
5 | Expression componentAdded(comps[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression componentRemoved(comps[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression componentAdded(comps[i]) is a void method call, and thus it cannot be parameterized |
8 | Expression componentRemoved(comps[i]) is a void method call, and thus it cannot be parameterized |