File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/ReportMenuBar.java | |||
Method name: void configure(TestElement)
|
Method name: void setEditMenu(JPopupMenu)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 5 | |||
1 | if (testElement instanceof HTTPSamplerBase) {↵ | |||
2 | HTTPSamplerBase base = (HTTPSamplerBase) testElement;↵ | |||
3 | tableModel.clearData();↵ | |||
4 | HTTPFileArg[] files = base.getHTTPFiles();↵ | |||
5 | ↵ | 1 | editMenu.removeAll();↵ | |
2 | Component[] comps = menu.getComponents();↵ | |||
6 | for(int i=0; i< files.length; i++){↵ | 3 | for (int i = 0; i < comps.length; i++) {↵ | |
7 | tableModel.addRow(files[i]); ↵ | |||
8 | }↵ | |||
9 | checkDeleteAndBrowseStatus();↵ | |||
10 | } | 4 | editMenu.add(comps[i]);↵ | |
5 | }↵ | |||
6 |
| |||
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 17 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | HTTPSamplerBase base = (HTTPSamplerBase)testElement; | | |||||||||||||||||||
| 3 | Component[] comps = menu.getComponents(); | |||||||||||||||||||
3 | tableModel.clearData(); | | |||||||||||||||||||
4 | HTTPFileArg[] files = base.getHTTPFiles(); | | |||||||||||||||||||
5 | for (int i = 0; i < files.length; i++) |
| 4 | for (int i = 0; i < comps.length; i++) | |||||||||||||||||
|
| 5 | editMenu.add(comps[i]); | ||||||||||||||||||
6 | tableModel.addRow(files[i]); |
| | ||||||||||||||||||
7 | checkDeleteAndBrowseStatus(); |
| 2 | editMenu.removeAll(); | |||||||||||||||||
| 6 | editMenu.setEnabled(true); |
Row | Violation |
---|---|
1 | Type org.apache.jmeter.protocol.http.util.HTTPFileArg[] of variable files does not match with type java.awt.Component[] of variable comps |
2 | Unmatched statement editMenu.add(comps[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement tableModel.addRow(files[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Expression checkDeleteAndBrowseStatus() is a void method call, and thus it cannot be parameterized |
5 | Expression editMenu.removeAll() is a void method call, and thus it cannot be parameterized |
6 | Expression checkDeleteAndBrowseStatus() is a void method call, and thus it cannot be parameterized |
7 | Expression editMenu.removeAll() is a void method call, and thus it cannot be parameterized |