File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/tree/ReportTreeModel.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/tree/JMeterTreeModel.java | |||
Method name: void traverseAndFind(Class, ReportTreeNode, List)
|
Method name: void traverseAndFind(Class, JMeterTreeNode, List)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if (type.isInstance(node.getUserObject())) {↵ | 1 | if (type.isInstance(node.getUserObject())) {↵ | |
2 | nodeList.add(node);↵ | 2 | nodeList.add(node);↵ | |
3 | }↵ | 3 | }↵ | |
4 | Enumeration enumNode = node.children();↵ | 4 | Enumeration enumNode = node.children();↵ | |
5 | while (enumNode.hasMoreElements()) {↵ | 5 | while (enumNode.hasMoreElements()) {↵ | |
6 | ReportTreeNode child = (ReportTreeNode) enumNode.nextElement();↵ | 6 | JMeterTreeNode child = (JMeterTreeNode) enumNode.nextElement();↵ | |
7 | traverseAndFind(type, child, nodeList);↵ | 7 | traverseAndFind(type, child, nodeList);↵ | |
8 | } | 8 |
| |
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.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 16 |
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) | 8.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (type.isInstance(node.getUserObject())) |
| 1 | if (type.isInstance(node.getUserObject())) | ||||||||||||||||||
2 | nodeList.add(node); |
| 2 | nodeList.add(node); | ||||||||||||||||||
3 | Enumeration enumNode = node.children(); |
| 3 | Enumeration enumNode = node.children(); | ||||||||||||||||||
4 | while (enumNode.hasMoreElements()) | 4 | while (enumNode.hasMoreElements()) | |||||||||||||||||||
5 | ReportTreeNode child = (ReportTreeNode)enumNode.nextElement(); |
| 5 | JMeterTreeNode child = (JMeterTreeNode)enumNode.nextElement(); | ||||||||||||||||||
6 | traverseAndFind(type, child, nodeList); |
| 6 | traverseAndFind(type, child, nodeList); |
Row | Violation |
---|---|
1 | Expression (ReportTreeNode)enumNode.nextElement() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression (JMeterTreeNode)enumNode.nextElement() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression child cannot be unified with expression child , because common superclass type javax.swing.tree.DefaultMutableTreeNode cannot be passed as an argument to private void traverseAndFind(Class#RAW, org.apache.jmeter.report.gui.tree.ReportTreeNode, List#RAW) |