if (responseCodeButton.isSelected()) { ra.setTestFieldResponseCode(); } else if (responseMessageButton.isSelected()) { ra.setTestFieldResponseMessage(); } else if (responseHeadersButton.isSelected()) { ra.setTestFieldResponseHeaders(); } else { // Assume URL ra.setTestFieldURL(); }
if (containsBox.isSelected()) { ra.setToContainsType(); } else if (equalsBox.isSelected()) { ra.setToEqualsType(); } else if (substringBox.isSelected()) { ra.setToSubstringType(); } else { ra.setToMatchType(); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/AssertionGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/AssertionGui.java
Method name: void modifyTestElement(TestElement) Method name: void modifyTestElement(TestElement)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (responseCodeButton.isSelected()) {
1
if (containsBox.isSelected()) {
2
				ra.setTestFieldResponseCode();
2
				ra.setToContainsType();
3
			} else if (responseMessageButton.isSelected()) {
3
			} else if (equalsBox.isSelected()) {
4
				ra.setTestFieldResponseMessage();
5
			} else if (responseHeadersButton
4
                ra.setToEqualsType();
6
.isSelected()) {
5
            } else if (substringBox.isSelected()) {
7
				ra.setTestFieldResponseHeaders();
6
                ra.setToSubstringType();
8
			} else { // Assume URL
7
			} else {
9
				ra.setTestFieldURL();
8
				ra.setToMatchType();
10
			}
9
			}
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.5
Clones locationClones are in the same method
Number of node comparisons37
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    if (responseCodeButton.isSelected())
    10
    if (responseCodeButton.isSelected())
    18
    if (containsBox.isSelected())
    Differences
    Expression1Expression2Difference
    responseCodeButtoncontainsBoxVARIABLE_NAME_MISMATCH
    18
    if (containsBox.isSelected())
    11
    ra.setTestFieldResponseCode();
    11
    ra.setTestFieldResponseCode();
    19
    ra.setToContainsType();
    Differences
    Expression1Expression2Difference
    setTestFieldResponseCodesetToContainsTypeMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression ra.setTestFieldResponseCode() is a void method call, and thus it cannot be parameterized
    Expression ra.setToContainsType() is a void method call, and thus it cannot be parameterized
    19
    ra.setToContainsType();
    12
    else if (responseMessageButton.isSelected())
    12
    else if (responseMessageButton.isSelected())
    20
    else if (equalsBox.isSelected())
    Differences
    Expression1Expression2Difference
    responseMessageButtonequalsBoxVARIABLE_NAME_MISMATCH
    20
    else if (equalsBox.isSelected())
    13
    ra.setTestFieldResponseMessage();
    13
    ra.setTestFieldResponseMessage();
    21
    ra.setToEqualsType();
    Differences
    Expression1Expression2Difference
    setTestFieldResponseMessagesetToEqualsTypeMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression ra.setTestFieldResponseMessage() is a void method call, and thus it cannot be parameterized
    Expression ra.setToEqualsType() is a void method call, and thus it cannot be parameterized
    21
    ra.setToEqualsType();
    14
    else if (responseHeadersButton.isSelected())
    14
    else if (responseHeadersButton.isSelected())
    22
    else if (substringBox.isSelected())
    Differences
    Expression1Expression2Difference
    responseHeadersButtonsubstringBoxVARIABLE_NAME_MISMATCH
    22
    else if (substringBox.isSelected())
    15
    ra.setTestFieldResponseHeaders();
    15
    ra.setTestFieldResponseHeaders();
    23
    ra.setToSubstringType();
    Differences
    Expression1Expression2Difference
    setTestFieldResponseHeaderssetToSubstringTypeMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression ra.setTestFieldResponseHeaders() is a void method call, and thus it cannot be parameterized
    Expression ra.setToSubstringType() is a void method call, and thus it cannot be parameterized
    23
    ra.setToSubstringType();
    else
    else
    16
    ra.setTestFieldURL();
    16
    ra.setTestFieldURL();
    24
    ra.setToMatchType();
    Differences
    Expression1Expression2Difference
    setTestFieldURLsetToMatchTypeMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression ra.setTestFieldURL() is a void method call, and thus it cannot be parameterized
    Expression ra.setToMatchType() is a void method call, and thus it cannot be parameterized
    24
    ra.setToMatchType();
    Precondition Violations (8)
    Row Violation
    1Expression ra.setTestFieldResponseCode() is a void method call, and thus it cannot be parameterized
    2Expression ra.setToContainsType() is a void method call, and thus it cannot be parameterized
    3Expression ra.setTestFieldResponseMessage() is a void method call, and thus it cannot be parameterized
    4Expression ra.setToEqualsType() is a void method call, and thus it cannot be parameterized
    5Expression ra.setTestFieldResponseHeaders() is a void method call, and thus it cannot be parameterized
    6Expression ra.setToSubstringType() is a void method call, and thus it cannot be parameterized
    7Expression ra.setTestFieldURL() is a void method call, and thus it cannot be parameterized
    8Expression ra.setToMatchType() is a void method call, and thus it cannot be parameterized