if (c instanceof CounterConfig) { CounterConfig config = (CounterConfig) c; config.setStart(startField.getText()); // Bug 22820 if (endField.getText().length() > 0) { config.setEnd(endField.getText()); } config.setIncrement(incrField.getText()); config.setVarName(varNameField.getText()); config.setFormat(formatField.getText()); config.setIsPerUser(perUserField.isSelected()); } super.configureTestElement(c);
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/modifiers/gui/CounterConfigGui.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: 9 Number of AST nodes: 8
1
if (c instanceof CounterConfig) {
2
			CounterConfig config = (CounterConfig) c;
3
			config.setStart(startField.getText());
4
			// Bug 22820 if (endField.getText().length() > 0)
5
			{
6
				config.setEnd(endField.getText());
7
			}
8
			config.setIncrement(incrField.getText());
9
			config.setVarName(varNameField.getText(
1
super.configureTestElement(element);
2
        ReportPage page = (ReportPage)element;
3
        page.setCSS(cssURL.getText());
4
        page.setFooterURL(footerURL.getText());
5
        page.setHeaderURL(headerURL.getText());
10
));
6
        page.setIndex(String.valueOf(makeIndex.isSelected()));
11
            config.setFormat(formatField.getText());
7
        
12
			config.setIsPerUser(perUserField.isSelected());
13
		}
14
		super.configureTestElemen
8
page.setIntroduction(introduction.getText());
15
t(c);
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 comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment4
    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
    4
    config.setEnd(endField.getText());
    4
    config.setEnd(endField.getText());
    1
    super.configureTestElement(element);
    Differences
    Expression1Expression2Difference
    config.setEnd(endField.getText())super.configureTestElement(element)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression config.setEnd(endField.getText()) 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;
                                                                      
    3
    page.setCSS(cssURL.getText());
                                                                                        
    4
    page.setFooterURL(footerURL.getText());
                                                                                        
    5
    page.setHeaderURL(headerURL.getText());
    5
    config.setIncrement(incrField.getText());
                                                                                            
                                                                                                                      
    6
    page.setIndex(String.valueOf(makeIndex.isSelected()));
    6
    config.setVarName(varNameField.getText());
                                                                                              
                                                                                                    
    7
    page.setIntroduction(introduction.getText());
    7
    config.setFormat(formatField.getText());
                                                                                          
    8
    config.setIsPerUser(perUserField.isSelected());
                                                                                                        
    9
    super.configureTestElement(c);
    9
    super.configureTestElement(c);
    8
    page.setTitle(pageTitle.getText());
    Differences
    Expression1Expression2Difference
    super.configureTestElement(c)page.setTitle(pageTitle.getText())TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression super.configureTestElement(c) 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());
    Precondition Violations (4)
    Row Violation
    1Expression config.setEnd(endField.getText()) 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
    3Expression super.configureTestElement(c) is a void method call, and thus it cannot be parameterized
    4Expression page.setTitle(pageTitle.getText()) is a void method call, and thus it cannot be parameterized