super.configureTestElement(extractor); if (extractor instanceof RegexExtractor) { RegexExtractor regex = (RegexExtractor) extractor; regex.setUseField(group.getSelection().getActionCommand()); regex.setRefName(refNameField.getText()); regex.setRegex(regexField.getText()); regex.setTemplate(templateField.getText()); regex.setDefaultValue(defaultField.getText()); regex.setMatchNumber(matchNumberField.getText()); }
this.configureTestElement(s); if (s instanceof SoapSampler) { SoapSampler sampler = (SoapSampler) s; sampler.setURLData(urlField.getText()); sampler.setXmlData(soapXml.getText()); sampler.setXmlFile(soapXmlFile.getFilename()); sampler.setSOAPAction(soapAction.getText()); sampler.setSendSOAPAction(sendSoapAction.isSelected()); sampler.setUseKeepAlive(useKeepAlive.isSelected()); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/extractor/gui/RegexExtractorGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/control/gui/SoapSamplerGui.java
Method name: void modifyTestElement(TestElement) Method name: void modifyTestElement(TestElement)
Number of AST nodes: 9 Number of AST nodes: 9
1
super.configureTestElement(extractor);
1
this.configureTestElement(s);
2
		if (extractor instanceof RegexExtractor) {
2
		if (s instanceof 
3
			RegexExtractor regex = (RegexExtractor) extractor;
4
			regex.setUseField(group.getSelection().getActionCommand
3
SoapSampler) {
4
			SoapSampler sampler = (SoapSampler) s;
5
());			
5
			sampler.setURLData(urlField.getText());
6
			regex.setRefName(refNameField.getText());
6
			
7
			regex.setRegex(regexField.getText());
8
			regex.setTemplate(templateField
7
sampler.setXmlData(soapXml.getText());
8
            sampler.setXmlFile(soapXmlFile.getFilename());
9
.getText());
9
			sampler.setSOAPAction(soapAction.getText());
10
			regex.setDefaultValue(defaultField.getText());
10
			
11
			regex.setMatchNumber(matchNumberField.getText
11
sampler.setSendSOAPAction(sendSoapAction.isSelected());
12
());
12
			sampler.setUseKeepAlive(useKeepAlive.isSelected());
13
		}
13
		}
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 having the same super class
Number of node comparisons65
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)18.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    super.configureTestElement(extractor);
    1
    super.configureTestElement(extractor);
    1
    this.configureTestElement(s);
    Differences
    Expression1Expression2Difference
    super.configureTestElement(extractor)this.configureTestElement(s)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression super.configureTestElement(extractor) is a void method call, and thus it cannot be parameterized
    Expression this.configureTestElement(s) is a void method call, and thus it cannot be parameterized
    1
    this.configureTestElement(s);
    2
    if (extractor instanceof RegexExtractor)
    2
    if (extractor instanceof RegexExtractor)
    2
    if (s instanceof SoapSampler)
    Differences
    Expression1Expression2Difference
    extractorsVARIABLE_NAME_MISMATCH
    org.apache.jmeter.extractor.RegexExtractororg.apache.jmeter.protocol.http.sampler.SoapSamplerSUBCLASS_TYPE_MISMATCH
    2
    if (s instanceof SoapSampler)
    3
    RegexExtractor regex = (RegexExtractor)extractor;
    3
    RegexExtractor regex = (RegexExtractor)extractor;
    3
    SoapSampler sampler = (SoapSampler)s;
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.extractor.RegexExtractororg.apache.jmeter.protocol.http.sampler.SoapSamplerSUBCLASS_TYPE_MISMATCH
    regexsamplerVARIABLE_NAME_MISMATCH
    org.apache.jmeter.extractor.RegexExtractororg.apache.jmeter.protocol.http.sampler.SoapSamplerSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.extractor.RegexExtractororg.apache.jmeter.protocol.http.sampler.SoapSamplerSUBCLASS_TYPE_MISMATCH
    extractorsVARIABLE_NAME_MISMATCH
    3
    SoapSampler sampler = (SoapSampler)s;
    4
    regex.setUseField(group.getSelection().getActionCommand());
                                                                                                                                
    5
    regex.setRefName(refNameField.getText());
    5
    regex.setRefName(refNameField.getText());
    4
    sampler.setURLData(urlField.getText());
    Differences
    Expression1Expression2Difference
    setRefNamesetURLDataMETHOD_INVOCATION_NAME_MISMATCH
    refNameFieldurlFieldVARIABLE_NAME_MISMATCH
    regexsamplerVARIABLE_NAME_MISMATCH
    org.apache.jmeter.extractor.RegexExtractororg.apache.jmeter.protocol.http.sampler.SoapSamplerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression regex.setRefName(refNameField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setURLData(urlField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression regex.setRefName(refNameField.getText()) is a void method call, and thus it cannot be parameterized
    Expression sampler.setURLData(urlField.getText()) is a void method call, and thus it cannot be parameterized
    4
    sampler.setURLData(urlField.getText());
    6
    regex.setRegex(regexField.getText());
    6
    regex.setRegex(regexField.getText());
    5
    sampler.setXmlData(soapXml.getText());
    Differences
    Expression1Expression2Difference
    setRegexsetXmlDataMETHOD_INVOCATION_NAME_MISMATCH
    regexFieldsoapXmlVARIABLE_NAME_MISMATCH
    org.apache.jorphan.gui.JLabeledTextFieldorg.apache.jorphan.gui.JLabeledTextAreaSUBCLASS_TYPE_MISMATCH
    regexsamplerVARIABLE_NAME_MISMATCH
    org.apache.jmeter.extractor.RegexExtractororg.apache.jmeter.protocol.http.sampler.SoapSamplerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression regex.setRegex(regexField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setXmlData(soapXml.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression regex.setRegex(regexField.getText()) is a void method call, and thus it cannot be parameterized
    Expression sampler.setXmlData(soapXml.getText()) is a void method call, and thus it cannot be parameterized
    Expression regexField cannot be unified with expression soapXml , because common superclass javax.swing.JPanel does not declare member(s) public java.lang.String getText()
    5
    sampler.setXmlData(soapXml.getText());
    7
    regex.setTemplate(templateField.getText());
    7
    regex.setTemplate(templateField.getText());
    6
    sampler.setXmlFile(soapXmlFile.getFilename());
    Differences
    Expression1Expression2Difference
    setTemplatesetXmlFileMETHOD_INVOCATION_NAME_MISMATCH
    getTextgetFilenameMETHOD_INVOCATION_NAME_MISMATCH
    templateFieldsoapXmlFileVARIABLE_NAME_MISMATCH
    org.apache.jorphan.gui.JLabeledTextFieldorg.apache.jmeter.gui.util.FilePanelSUBCLASS_TYPE_MISMATCH
    regexsamplerVARIABLE_NAME_MISMATCH
    org.apache.jmeter.extractor.RegexExtractororg.apache.jmeter.protocol.http.sampler.SoapSamplerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression regex.setTemplate(templateField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setXmlFile(soapXmlFile.getFilename()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression regex.setTemplate(templateField.getText()) is a void method call, and thus it cannot be parameterized
    Expression sampler.setXmlFile(soapXmlFile.getFilename()) is a void method call, and thus it cannot be parameterized
    6
    sampler.setXmlFile(soapXmlFile.getFilename());
    8
    regex.setDefaultValue(defaultField.getText());
    8
    regex.setDefaultValue(defaultField.getText());
    7
    sampler.setSOAPAction(soapAction.getText());
    Differences
    Expression1Expression2Difference
    setDefaultValuesetSOAPActionMETHOD_INVOCATION_NAME_MISMATCH
    defaultFieldsoapActionVARIABLE_NAME_MISMATCH
    regexsamplerVARIABLE_NAME_MISMATCH
    org.apache.jmeter.extractor.RegexExtractororg.apache.jmeter.protocol.http.sampler.SoapSamplerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression regex.setDefaultValue(defaultField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setSOAPAction(soapAction.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression regex.setDefaultValue(defaultField.getText()) is a void method call, and thus it cannot be parameterized
    Expression sampler.setSOAPAction(soapAction.getText()) is a void method call, and thus it cannot be parameterized
    7
    sampler.setSOAPAction(soapAction.getText());
                                                                                                                        
    8
    sampler.setSendSOAPAction(sendSoapAction.isSelected());
                                                                                                                
    9
    sampler.setUseKeepAlive(useKeepAlive.isSelected());
    9
    regex.setMatchNumber(matchNumberField.getText());
                                                                                                            
    Precondition Violations (20)
    Row Violation
    1Expression super.configureTestElement(extractor) is a void method call, and thus it cannot be parameterized
    2Expression this.configureTestElement(s) is a void method call, and thus it cannot be parameterized
    3Expression regex.setRefName(refNameField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression sampler.setURLData(urlField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression regex.setRefName(refNameField.getText()) is a void method call, and thus it cannot be parameterized
    6Expression sampler.setURLData(urlField.getText()) is a void method call, and thus it cannot be parameterized
    7Expression regex.setRegex(regexField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression sampler.setXmlData(soapXml.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression regex.setRegex(regexField.getText()) is a void method call, and thus it cannot be parameterized
    10Expression sampler.setXmlData(soapXml.getText()) is a void method call, and thus it cannot be parameterized
    11Expression regexField cannot be unified with expression soapXml , because common superclass javax.swing.JPanel does not declare member(s) public java.lang.String getText()
    12Expression regex.setTemplate(templateField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression sampler.setXmlFile(soapXmlFile.getFilename()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression regex.setTemplate(templateField.getText()) is a void method call, and thus it cannot be parameterized
    15Expression sampler.setXmlFile(soapXmlFile.getFilename()) is a void method call, and thus it cannot be parameterized
    16Expression regex.setDefaultValue(defaultField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression sampler.setSOAPAction(soapAction.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression regex.setDefaultValue(defaultField.getText()) is a void method call, and thus it cannot be parameterized
    19Expression sampler.setSOAPAction(soapAction.getText()) is a void method call, and thus it cannot be parameterized
    20Clone fragment #1 returns variable regex with type org.apache.jmeter.extractor.RegexExtractor , while Clone fragment #2 returns variable sampler with type org.apache.jmeter.protocol.http.sampler.SoapSampler