String data = node.getData();
if (data != null && data.length() > 0) {
String value = "<!-[CDATA" + node.getData() + "]]>"; // $NON-NLS-1$ $NON-NLS-2$
XMLDefaultMutableTreeNode commentNode = new XMLDefaultMutableTreeNode(value, node);
mTreeNode.add(commentNode);
}
String data = node.getData();
if (data != null && data.length() > 0) {
String value = "<!--" + node.getData() + "-->"; // $NON-NLS-1$ $NON-NLS-2$
XMLDefaultMutableTreeNode commentNode = new XMLDefaultMutableTreeNode(value, node);
mTreeNode.add(commentNode);
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/XMLDefaultMutableTreeNode.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/XMLDefaultMutableTreeNode.java
|
Method name: void initCDATASectionNode(CDATASection, DefaultMutableTreeNode)
|
|
Method name: void initCommentNode(Comment, DefaultMutableTreeNode)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | String data = node.getData();↵ | | 1 | String data = node.getData();↵
|
2 | if (data != null && data.length() > 0) {↵ | | 2 | if (data != null && data.length() > 0) {↵
|
3 | String value = "<!-[CDATA" + node.getData() + "]]>"; // $NON-NLS-1$ $NON-NLS-2$↵ | | 3 | String value = "<!--" + node.getData() + "-->"; // $NON-NLS-1$ $NON-NLS-2$↵
|
4 | XMLDefaultMutableTreeNode commentNode = new XMLDefaultMutableTreeNode(value, node);↵ | | 4 | XMLDefaultMutableTreeNode commentNode = new XMLDefaultMutableTreeNode(value, node);↵
|
5 | mTreeNode.add(commentNode);↵ | | 5 | mTreeNode.add(commentNode);↵
|
6 | } | | 6 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
-
{Refactorable}
Mapping Summary
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.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | String data = node.getData(); | | 1 | String data = node.getData(); |
2 | if (data != null && data.length() > 0) | | 2 | if (data != null && data.length() > 0) |
3 | String value = "<!-[CDATA" + node.getData() + "]]>"; | |