while (names.hasMoreElements()) { String prop = (String) names.nextElement(); if (prop.startsWith(name)) { Object o = instantiate(properties.getProperty(prop), "org.apache.jmeter.control.SamplerController"); // $NON-NLS-1$ v.addElement(o); } }
Element comp = (Element) components.get(j); String nm=comp.getAttributeValue("name"); if (!nm.equals("SSL Manager")){// Not a true GUI component guiTitles.put(nm.replace(' ','_'), Boolean.FALSE); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/JMeterUtils.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTest.java
Method name: Vector getControllers(Properties) Method name: void createTitleSet()
Number of AST nodes: 5 Number of AST nodes: 4
1
while (names.hasMoreElements()) {
2
			String prop = (
1
Element comp = (Element) components.get(j);
3
String) names.nextElement();
2
                String n
4
			if (prop.startsWith(name)) {
5
				Object o = instantiate(properties.getProperty(prop), 
6
						"org.apache.jmeter.control.SamplerController"); // $NON-NLS-1$
7
				v.addElement(o);
8
			}
9
		
3
m=comp.getAttributeValue("name");
4
                if (!nm.equals("SSL Manager")){// Not a true GUI component
5
				    guiTitles.put(nm.replace(' ','_'), Boolean.FALSE);
10
}
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.1
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                            
    12
    Element comp = (Element)components.get(j);
    Preondition Violations
    Unmatched statement Element comp=(Element)components.get(j); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12
    Element comp = (Element)components.get(j);
    5
    String prop = (String)names.nextElement();
    5
    String prop = (String)names.nextElement();
    13
    String nm = comp.getAttributeValue("name");
    Differences
    Expression1Expression2Difference
    propnmVARIABLE_NAME_MISMATCH
    (String)names.nextElement()comp.getAttributeValue("name")TYPE_COMPATIBLE_REPLACEMENT
    13
    String nm = comp.getAttributeValue("name");
    6
    if (prop.startsWith(name))
    6
    if (prop.startsWith(name))
    14
    if (!nm.equals("SSL Manager"))
    Differences
    Expression1Expression2Difference
    prop.startsWith(name)!nm.equals("SSL Manager")TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression prop.startsWith(name) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression !nm.equals("SSL Manager") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!nm.equals("SSL Manager"))
    7
    Object o = instantiate(properties.getProperty(prop), "org.apache.jmeter.control.SamplerController");
    7
    Object o = instantiate(properties.getProperty(prop), "org.apache.jmeter.control.SamplerController");
    Preondition Violations
    Unmatched statement Object o=instantiate(properties.getProperty(prop),"org.apache.jmeter.control.SamplerController"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                            
    8
    v.addElement(o);
                                          
                                                                                                              
    15
    guiTitles.put(nm.replace(' ', '_'), Boolean.FALSE);
    Preondition Violations
    Unmatched statement guiTitles.put(nm.replace(' ','_'),Boolean.FALSE); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15
    guiTitles.put(nm.replace(' ', '_'), Boolean.FALSE);
    Precondition Violations (5)
    Row Violation
    1Unmatched statement Element comp=(Element)components.get(j); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression prop.startsWith(name) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression !nm.equals("SSL Manager") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched statement Object o=instantiate(properties.getProperty(prop),"org.apache.jmeter.control.SamplerController"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement guiTitles.put(nm.replace(' ','_'),Boolean.FALSE); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted