ParamModifier modifier = (ParamModifier) m; ParamMask mask = modifier.getMask(); mask.setFieldName(_fieldName.getText()); mask.setPrefix(_prefix.getText()); mask.setLowerBound(Long.parseLong(_lowerBound.getText())); mask.setIncrement(Long.parseLong(_increment.getText())); mask.setUpperBound(Long.parseLong(_upperBound.getText())); mask.setSuffix(_suffix.getText());
super.modifyTestElement(c); MailerModel mailerModel = ((MailerResultCollector) c).getMailerModel(); mailerModel.setFailureLimit(failureLimitField.getText()); mailerModel.setFailureSubject(failureSubjectField.getText()); mailerModel.setFromAddress(fromField.getText()); mailerModel.setSmtpHost(smtpHostField.getText()); mailerModel.setSuccessLimit(successLimitField.getText()); mailerModel.setSuccessSubject(successSubjectField.getText()); mailerModel.setToAddress(addressField.getText());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/modifier/gui/ParamModifierGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/MailerVisualizer.java
Method name: void modifyTestElement(TestElement) Method name: void modifyTestElement(TestElement)
Number of AST nodes: 8 Number of AST nodes: 9
1
ParamModifier modifier = (ParamModifier) m;
2
			ParamMask mask = modifier.getMask
1
super.modifyTestElement(c);
2
		MailerModel mailerModel = ((MailerResultCollector) c).getMailerModel();
3
();
3
		mailerModel.setFailureLimit(failureLimitField.getText());
4
			mask.setFieldName(_fieldName.getText());
4
		mailerModel.setFailureSubject(failureSubjectField.getText());
5
			mask.setPrefix(_prefix.getText());
5
		mailerModel.setFromAddress(fromField.getText());
6
			mask.setLowerBound(Long.parseLong(_lowerBound.getText()));
6
		mailerModel.setSmtpHost(smtpHostField.getText());
7
			mask.setIncrement(Long.parseLong(_increment.getText()));
7
		mailerModel.setSuccessLimit(successLimitField.getText());
8
			mask.setUpperBound(Long.parseLong(_upperBound.getText()));
8
		mailerModel.setSuccessSubject(successSubjectField.getText());
9
			mask.setSuffix(_suffix.getText());
9
		mailerModel.setToAddress(addressField.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 comparisons72
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    ParamModifier modifier = (ParamModifier)m;
    3
    ParamModifier modifier = (ParamModifier)m;
    2
    MailerModel mailerModel = ((MailerResultCollector)c).getMailerModel();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.protocol.http.modifier.ParamModifierorg.apache.jmeter.reporters.MailerModelSUBCLASS_TYPE_MISMATCH
    modifiermailerModelVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.modifier.ParamModifierorg.apache.jmeter.reporters.MailerModelSUBCLASS_TYPE_MISMATCH
    (ParamModifier)m((MailerResultCollector)c).getMailerModel()TYPE_COMPATIBLE_REPLACEMENT
    2
    MailerModel mailerModel = ((MailerResultCollector)c).getMailerModel();
    4
    ParamMask mask = modifier.getMask();
    4
    ParamMask mask = modifier.getMask();
    Preondition Violations
    Unmatched statement ParamMask mask=modifier.getMask(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                              
    5
    mask.setFieldName(_fieldName.getText());
    5
    mask.setFieldName(_fieldName.getText());
    1
    super.modifyTestElement(c);
    Differences
    Expression1Expression2Difference
    mask.setFieldName(_fieldName.getText())super.modifyTestElement(c)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression mask.setFieldName(_fieldName.getText()) is a void method call, and thus it cannot be parameterized
    Expression super.modifyTestElement(c) is a void method call, and thus it cannot be parameterized
    1
    super.modifyTestElement(c);
                                                                                                                            
    3
    mailerModel.setFailureLimit(failureLimitField.getText());
                                                                                                                                    
    4
    mailerModel.setFailureSubject(failureSubjectField.getText());
                                                                                                          
    5
    mailerModel.setFromAddress(fromField.getText());
    6
    mask.setPrefix(_prefix.getText());
    6
    mask.setPrefix(_prefix.getText());
    6
    mailerModel.setSmtpHost(smtpHostField.getText());
    Differences
    Expression1Expression2Difference
    setPrefixsetSmtpHostMETHOD_INVOCATION_NAME_MISMATCH
    _prefixsmtpHostFieldVARIABLE_NAME_MISMATCH
    maskmailerModelVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.modifier.ParamMaskorg.apache.jmeter.reporters.MailerModelSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression mailerModel.setSmtpHost(smtpHostField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mask.setPrefix(_prefix.getText()) is a void method call, and thus it cannot be parameterized
    Expression mailerModel.setSmtpHost(smtpHostField.getText()) is a void method call, and thus it cannot be parameterized
    Expression mailerModel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    mailerModel.setSmtpHost(smtpHostField.getText());
                                                                                                                            
    7
    mailerModel.setSuccessLimit(successLimitField.getText());
    7
    mask.setLowerBound(Long.parseLong(_lowerBound.getText()));
                                                                                                                              
                                                                                                                                    
    8
    mailerModel.setSuccessSubject(successSubjectField.getText());
    8
    mask.setIncrement(Long.parseLong(_increment.getText()));
                                                                                                                          
    9
    mask.setUpperBound(Long.parseLong(_upperBound.getText()));
                                                                                                                              
    10
    mask.setSuffix(_suffix.getText());
    10
    mask.setSuffix(_suffix.getText());
    9
    mailerModel.setToAddress(addressField.getText());
    Differences
    Expression1Expression2Difference
    setSuffixsetToAddressMETHOD_INVOCATION_NAME_MISMATCH
    _suffixaddressFieldVARIABLE_NAME_MISMATCH
    maskmailerModelVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.modifier.ParamMaskorg.apache.jmeter.reporters.MailerModelSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression mailerModel.setToAddress(addressField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mask.setSuffix(_suffix.getText()) is a void method call, and thus it cannot be parameterized
    Expression mailerModel.setToAddress(addressField.getText()) is a void method call, and thus it cannot be parameterized
    Expression mailerModel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    mailerModel.setToAddress(addressField.getText());
    Precondition Violations (12)
    Row Violation
    1Unmatched statement ParamMask mask=modifier.getMask(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression mask.setFieldName(_fieldName.getText()) is a void method call, and thus it cannot be parameterized
    3Expression super.modifyTestElement(c) is a void method call, and thus it cannot be parameterized
    4Expression mailerModel.setSmtpHost(smtpHostField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression mask.setPrefix(_prefix.getText()) is a void method call, and thus it cannot be parameterized
    6Expression mailerModel.setSmtpHost(smtpHostField.getText()) is a void method call, and thus it cannot be parameterized
    7Expression mailerModel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression mailerModel.setToAddress(addressField.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression mask.setSuffix(_suffix.getText()) is a void method call, and thus it cannot be parameterized
    10Expression mailerModel.setToAddress(addressField.getText()) is a void method call, and thus it cannot be parameterized
    11Expression mailerModel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Clone fragment #1 returns variable modifier with type org.apache.jmeter.protocol.http.modifier.ParamModifier , while Clone fragment #2 returns variable mailerModel with type org.apache.jmeter.reporters.MailerModel