sampler.clear(); urlConfigGui.modifyTestElement(sampler); final HTTPSamplerBase samplerBase = (HTTPSamplerBase) sampler; if (getImages.isSelected()) { samplerBase.setImageParser(true); } else { // The default is false, so we can remove the property to simplify JMX files // This also allows HTTPDefaults to work for this checkbox sampler.removeProperty(HTTPSamplerBase.IMAGE_PARSER); } samplerBase.setMonitor(isMon.isSelected()); samplerBase.setMD5(useMD5.isSelected()); samplerBase.setEmbeddedUrlRE(embeddedRE.getText()); this.configureTestElement(sampler);
super.configureTestElement(element); ReportPage page = (ReportPage)element; page.setCSS(cssURL.getText()); page.setFooterURL(footerURL.getText()); page.setHeaderURL(headerURL.getText()); page.setIndex(String.valueOf(makeIndex.isSelected())); page.setIntroduction(introduction.getText()); page.setTitle(pageTitle.getText());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/ReportPageGui.java
Method name: void modifyTestElement(TestElement) Method name: void modifyTestElement(TestElement)
Number of AST nodes: 10 Number of AST nodes: 8
1
sampler.clear();
1
s
2
        urlConfigGui.modifyTestElement(sampler);
3
		final HTTPSamplerBase samplerBase = (HTTPSamplerBase) sampler;
4
		if (getImages.isSelected()) {
5
			samplerBase.setImageParser(true);
6
		} else {
7
			// The default is false, so we can remove the property to simplify JMX files
8
			// This also allows HTTPDefaults to work for this checkbox
9
			sampler.removeProperty(HTTPSamplerBase.IMAGE_PARSER);
10
		}
11
		samplerBase.setMonitor(isMon.isSelected());
12
        samplerBase.setMD5(useMD5
2
uper.configureTestElement(element);
3
        ReportPage page = (ReportPage)element;
4
        page.setCSS(cssURL.getText());
5
        page.setFooterURL(footerURL.getText());
6
        page.setHeaderURL(headerURL.getText());
13
.isSelected());
7
        page.setIndex(String.valueOf(makeIndex.isSelected()));
14
		samplerBase.setEmbeddedUrlRE(embeddedRE.getText());
15
		this.configureTestElement(sampler
8
        page.setIntroduction(introduction.getText());
16
);
9
        page.setTitle(pageTitle.getText());
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons56
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment8
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    sampler.clear();
    1
    sampler.clear();
    1
    super.configureTestElement(element);
    Differences
    Expression1Expression2Difference
    sampler.clear()super.configureTestElement(element)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression sampler.clear() is a void method call, and thus it cannot be parameterized
    Expression super.configureTestElement(element) is a void method call, and thus it cannot be parameterized
    1
    super.configureTestElement(element);
                                                                                  
    2
    ReportPage page = (ReportPage)element;
    2
    urlConfigGui.modifyTestElement(sampler);
    2
    urlConfigGui.modifyTestElement(sampler);
    Preondition Violations
    Unmatched statement urlConfigGui.modifyTestElement(sampler); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                          
                                                                      
    3
    page.setCSS(cssURL.getText());
    3
    final HTTPSamplerBase samplerBase = (HTTPSamplerBase)sampler;
                                                                                                                                
                                                                                        
    4
    page.setFooterURL(footerURL.getText());
    4
    if (getImages.isSelected())
                                                              
    5
    samplerBase.setImageParser(true);
                                                                            
    else
            
    6
    sampler.removeProperty(HTTPSamplerBase.IMAGE_PARSER);
                                                                                                                    
                                                                                        
    5
    page.setHeaderURL(headerURL.getText());
                                                                                                                      
    6
    page.setIndex(String.valueOf(makeIndex.isSelected()));
                                                                                                    
    7
    page.setIntroduction(introduction.getText());
    7
    samplerBase.setMonitor(isMon.isSelected());
                                                                                                
    8
    samplerBase.setMD5(useMD5.isSelected());
                                                                                          
    9
    samplerBase.setEmbeddedUrlRE(embeddedRE.getText());
    9
    samplerBase.setEmbeddedUrlRE(embeddedRE.getText());
    8
    page.setTitle(pageTitle.getText());
    Differences
    Expression1Expression2Difference
    setEmbeddedUrlREsetTitleMETHOD_INVOCATION_NAME_MISMATCH
    embeddedREpageTitleVARIABLE_NAME_MISMATCH
    samplerBasepageVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.sampler.HTTPSamplerBaseorg.apache.jmeter.testelement.ReportPageSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression samplerBase.setEmbeddedUrlRE(embeddedRE.getText()) is a void method call, and thus it cannot be parameterized
    Expression page.setTitle(pageTitle.getText()) is a void method call, and thus it cannot be parameterized
    8
    page.setTitle(pageTitle.getText());
    10
    this.configureTestElement(sampler);
    10
    this.configureTestElement(sampler);
    Preondition Violations
    Unmatched statement this.configureTestElement(sampler); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                  
    Precondition Violations (6)
    Row Violation
    1Expression sampler.clear() is a void method call, and thus it cannot be parameterized
    2Expression super.configureTestElement(element) is a void method call, and thus it cannot be parameterized
    3Unmatched statement urlConfigGui.modifyTestElement(sampler); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Expression samplerBase.setEmbeddedUrlRE(embeddedRE.getText()) is a void method call, and thus it cannot be parameterized
    5Expression page.setTitle(pageTitle.getText()) is a void method call, and thus it cannot be parameterized
    6Unmatched statement this.configureTestElement(sampler); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted