Element section = body.getChild("section"); List sections = section.getChildren("subsection"); for (int i = 0; i < sections.size(); i++) { List components = ((Element) sections.get(i)).getChildren("component"); for (int j = 0; j < components.size(); j++) { Element comp = (Element) components.get(j); funcTitles.put(comp.getAttributeValue("name"), Boolean.FALSE); } }
Element body = root.getChild("body"); List sections = body.getChildren("section"); for (int i = 0; i < sections.size(); i++) { List components = ((Element) sections.get(i)).getChildren("component"); for (int j = 0; j < components.size(); j++) { Element comp = (Element) components.get(j); guiTags.put(comp.getAttributeValue("tag"), Boolean.FALSE); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTest.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTest.java
Method name: void createFunctionSet() Method name: void createTagSet()
Number of AST nodes: 7 Number of AST nodes: 7
1
Element section = body.getChild("section");
1
Element body = root.getChild("body");
2
		List sections = section.getChildren("subsection");
2
		List sections = body.getChildren("section");
3
		for (int i = 0; i < sections.size(); i++) {
3
		for (int i = 0; i < sections.size(); i++) {
4
			List components = ((Element) sections.get(i)).getChildren("component");
4
			List components = ((Element) sections.get(i)).getChildren("component");
5
			for (int j = 0; j < components.size(); j++) {
5
			for (int j = 0; j < components.size(); j++) {
6
				Element comp = (Element) components.get(j);
6
				Element comp = (Element) components.get(j);
7
				funcTitles.put(comp.getAttributeValue("name"), Boolean.FALSE);
7
				guiTags.put(comp.getAttributeValue("tag"), Boolean.FALSE);
8
			}
8
			}
9
		}
9
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are declared in the same class
Number of node comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    Element section = body.getChild("section");
    8
    Element section = body.getChild("section");
    7
    Element body = root.getChild("body");
    Differences
    Expression1Expression2Difference
    sectionbodyVARIABLE_NAME_MISMATCH
    "section""body"LITERAL_VALUE_MISMATCH
    bodyrootVARIABLE_NAME_MISMATCH
    7
    Element body = root.getChild("body");
    9
    List sections = section.getChildren("subsection");
    9
    List sections = section.getChildren("subsection");
    8
    List sections = body.getChildren("section");
    Differences
    Expression1Expression2Difference
    "subsection""section"LITERAL_VALUE_MISMATCH
    sectionbodyVARIABLE_NAME_MISMATCH
    8
    List sections = body.getChildren("section");
    10
    for (int i = 0; i < sections.size(); i++)
    9
    for (int i = 0; i < sections.size(); i++)
    11
    List components = ((Element)sections.get(i)).getChildren("component");
    10
    List components = ((Element)sections.get(i)).getChildren("component");
    12
    for (int j = 0; j < components.size(); j++)
    11
    for (int j = 0; j < components.size(); j++)
    13
    Element comp = (Element)components.get(j);
    12
    Element comp = (Element)components.get(j);
    14
    funcTitles.put(comp.getAttributeValue("name"), Boolean.FALSE);
    14
    funcTitles.put(comp.getAttributeValue("name"), Boolean.FALSE);
    13
    guiTags.put(comp.getAttributeValue("tag"), Boolean.FALSE);
    Differences
    Expression1Expression2Difference
    "name""tag"LITERAL_VALUE_MISMATCH
    funcTitlesguiTagsVARIABLE_NAME_MISMATCH
    13
    guiTags.put(comp.getAttributeValue("tag"), Boolean.FALSE);
    Precondition Violations (0)
    Row Violation