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());
te.clear(); this.configureTestElement(te); BSFSampler sampler = (BSFSampler) te; sampler.setFilename(filename.getText()); sampler.setScriptLanguage((String) langField.getSelectedItem()); sampler.setParameters(parameters.getText()); sampler.setScript(scriptField.getText());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/control/gui/SoapSamplerGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/java/control/gui/BSFSamplerGui.java
Method name: void modifyTestElement(TestElement) Method name: void modifyTestElement(TestElement)
Number of AST nodes: 7 Number of AST nodes: 7
1
Soap
1
te.clear();
2
		this.configureTestElement(te);
2
Sampler sampler = (SoapSampler) s;
3
		BSFSampler sampler = (BSFSampler) te;
3
			sampler.setURLData(urlField.getText());
4
		sampler.setFilename(filename.getText());
4
			sampler.setXmlData(soapXml.getText());
5
		sampler.set
5
            sampler.setXmlFile(soapXmlFile.getFilename());
6
ScriptLanguage((String) langField.getSelectedItem());
6
			sampler.setSOAPAction(soapAction.getText());
7
		sampler.setParameters(parameters.getText());
7
			sampler.setSendSOAPAction(sendSoapAction.isSelected());
8
		sampler.setS
8
			sampler.setUseKeepAlive(useKeepAlive.isSelected());
9
cript(scriptField.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 comparisons49
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                
    1
    te.clear();
                                                                      
    2
    this.configureTestElement(te);
    3
    SoapSampler sampler = (SoapSampler)s;
    3
    SoapSampler sampler = (SoapSampler)s;
    3
    BSFSampler sampler = (BSFSampler)te;
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.protocol.http.sampler.SoapSamplerorg.apache.jmeter.protocol.java.sampler.BSFSamplerSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.protocol.http.sampler.SoapSamplerorg.apache.jmeter.protocol.java.sampler.BSFSamplerSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.protocol.http.sampler.SoapSamplerorg.apache.jmeter.protocol.java.sampler.BSFSamplerSUBCLASS_TYPE_MISMATCH
    steVARIABLE_NAME_MISMATCH
    3
    BSFSampler sampler = (BSFSampler)te;
    4
    sampler.setURLData(urlField.getText());
    4
    sampler.setURLData(urlField.getText());
    5
    sampler.setScriptLanguage((String)langField.getSelectedItem());
    Differences
    Expression1Expression2Difference
    setURLDatasetScriptLanguageMETHOD_INVOCATION_NAME_MISMATCH
    urlField.getText()(String)langField.getSelectedItem()TYPE_COMPATIBLE_REPLACEMENT
    org.apache.jmeter.protocol.http.sampler.SoapSamplerorg.apache.jmeter.protocol.java.sampler.BSFSamplerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression sampler.setURLData(urlField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setScriptLanguage((String)langField.getSelectedItem()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setURLData(urlField.getText()) is a void method call, and thus it cannot be parameterized
    Expression sampler.setScriptLanguage((String)langField.getSelectedItem()) is a void method call, and thus it cannot be parameterized
    5
    sampler.setScriptLanguage((String)langField.getSelectedItem());
    5
    sampler.setXmlData(soapXml.getText());
    5
    sampler.setXmlData(soapXml.getText());
    4
    sampler.setFilename(filename.getText());
    Differences
    Expression1Expression2Difference
    setXmlDatasetFilenameMETHOD_INVOCATION_NAME_MISMATCH
    soapXmlfilenameVARIABLE_NAME_MISMATCH
    org.apache.jorphan.gui.JLabeledTextAreajavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.protocol.http.sampler.SoapSamplerorg.apache.jmeter.protocol.java.sampler.BSFSamplerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression sampler.setXmlData(soapXml.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setFilename(filename.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setXmlData(soapXml.getText()) is a void method call, and thus it cannot be parameterized
    Expression sampler.setFilename(filename.getText()) is a void method call, and thus it cannot be parameterized
    4
    sampler.setFilename(filename.getText());
    6
    sampler.setXmlFile(soapXmlFile.getFilename());
    6
    sampler.setXmlFile(soapXmlFile.getFilename());
    6
    sampler.setParameters(parameters.getText());
    Differences
    Expression1Expression2Difference
    setXmlFilesetParametersMETHOD_INVOCATION_NAME_MISMATCH
    getFilenamegetTextMETHOD_INVOCATION_NAME_MISMATCH
    soapXmlFileparametersVARIABLE_NAME_MISMATCH
    org.apache.jmeter.gui.util.FilePaneljavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.protocol.http.sampler.SoapSamplerorg.apache.jmeter.protocol.java.sampler.BSFSamplerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression sampler.setXmlFile(soapXmlFile.getFilename()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setParameters(parameters.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setXmlFile(soapXmlFile.getFilename()) is a void method call, and thus it cannot be parameterized
    Expression sampler.setParameters(parameters.getText()) is a void method call, and thus it cannot be parameterized
    6
    sampler.setParameters(parameters.getText());
    7
    sampler.setSOAPAction(soapAction.getText());
    7
    sampler.setSOAPAction(soapAction.getText());
    7
    sampler.setScript(scriptField.getText());
    Differences
    Expression1Expression2Difference
    setSOAPActionsetScriptMETHOD_INVOCATION_NAME_MISMATCH
    soapActionscriptFieldVARIABLE_NAME_MISMATCH
    org.apache.jorphan.gui.JLabeledTextFieldjavax.swing.JTextAreaSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.protocol.http.sampler.SoapSamplerorg.apache.jmeter.protocol.java.sampler.BSFSamplerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression sampler.setSOAPAction(soapAction.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setScript(scriptField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.setSOAPAction(soapAction.getText()) is a void method call, and thus it cannot be parameterized
    Expression sampler.setScript(scriptField.getText()) is a void method call, and thus it cannot be parameterized
    7
    sampler.setScript(scriptField.getText());
    8
    sampler.setSendSOAPAction(sendSoapAction.isSelected());
                                                                                                                        
    9
    sampler.setUseKeepAlive(useKeepAlive.isSelected());
                                                                                                                
    Precondition Violations (17)
    Row Violation
    1Expression sampler.setURLData(urlField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression sampler.setScriptLanguage((String)langField.getSelectedItem()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression sampler.setURLData(urlField.getText()) is a void method call, and thus it cannot be parameterized
    4Expression sampler.setScriptLanguage((String)langField.getSelectedItem()) is a void method call, and thus it cannot be parameterized
    5Expression sampler.setXmlData(soapXml.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression sampler.setFilename(filename.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression sampler.setXmlData(soapXml.getText()) is a void method call, and thus it cannot be parameterized
    8Expression sampler.setFilename(filename.getText()) is a void method call, and thus it cannot be parameterized
    9Expression sampler.setXmlFile(soapXmlFile.getFilename()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression sampler.setParameters(parameters.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression sampler.setXmlFile(soapXmlFile.getFilename()) is a void method call, and thus it cannot be parameterized
    12Expression sampler.setParameters(parameters.getText()) is a void method call, and thus it cannot be parameterized
    13Expression sampler.setSOAPAction(soapAction.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression sampler.setScript(scriptField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression sampler.setSOAPAction(soapAction.getText()) is a void method call, and thus it cannot be parameterized
    16Expression sampler.setScript(scriptField.getText()) is a void method call, and thus it cannot be parameterized
    17Clone fragment #1 returns variables sampler , while Clone fragment #2 returns variables