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
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String data = node.getData();
    1
    String data = node.getData();
    1
    String data = node.getData();
    Differences
    Expression1Expression2Difference
    org.w3c.dom.CDATASectionorg.w3c.dom.CommentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.w3c.dom.CDATASection of variable node does not match with type org.w3c.dom.Comment of variable node
    • Make classes org.w3c.dom.CDATASection and org.w3c.dom.Comment extend a common superclass
    1
    String data = node.getData();
    2
    if (data != null && data.length() > 0)
    2
    if (data != null && data.length() > 0)
                                                                                                    
    3
    String value = "<!--" + node.getData() + "-->";
    3
    String value = "<!-[CDATA" + node.getData() + "]]>";
                                                                                                              
    4
    XMLDefaultMutableTreeNode commentNode = new XMLDefaultMutableTreeNode(value, node);
    4
    XMLDefaultMutableTreeNode commentNode = new XMLDefaultMutableTreeNode(value, node);
    4
    XMLDefaultMutableTreeNode commentNode = new XMLDefaultMutableTreeNode(value, node);
    Differences
    Expression1Expression2Difference
    org.w3c.dom.CDATASectionorg.w3c.dom.CommentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.w3c.dom.CDATASection of variable node does not match with type org.w3c.dom.Comment of variable node
    • Make classes org.w3c.dom.CDATASection and org.w3c.dom.Comment extend a common superclass
    4
    XMLDefaultMutableTreeNode commentNode = new XMLDefaultMutableTreeNode(value, node);
    5
    mTreeNode.add(commentNode);
    5
    mTreeNode.add(commentNode);
    Precondition Violations (2)
    Row Violation
    1Type org.w3c.dom.CDATASection of variable node does not match with type org.w3c.dom.Comment of variable node
    2Type org.w3c.dom.CDATASection of variable node does not match with type org.w3c.dom.Comment of variable node