if (sampler.getSuccess().length() > 0) { successMsg.setText(sampler.getSuccess()); } else { successMsg.setText(JMeterUtils.getResString("junit_success_default_msg")); //$NON-NLS-1$ } if (sampler.getFailureCode().length() > 0) { failureCode.setText(sampler.getFailureCode()); } else { failureCode.setText(JMeterUtils.getResString("junit_failure_default_code")); //$NON-NLS-1$ } if (sampler.getFailure().length() > 0) { failureMsg.setText(sampler.getFailure()); } else { failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg")); //$NON-NLS-1$ } if (sampler.getError().length() > 0) { errorMsg.setText(sampler.getError()); } else { errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg")); //$NON-NLS-1$ } if (sampler.getErrorCode().length() > 0) { errorCode.setText(sampler.getErrorCode()); } else { errorCode.setText(JMeterUtils.getResString("junit_error_default_code")); //$NON-NLS-1$ }
if (sampler.getSuccessCode().length() > 0) { successCode.setText(sampler.getSuccessCode()); } else { successCode.setText(JMeterUtils.getResString("junit_success_default_code")); //$NON-NLS-1$ } if (sampler.getSuccess().length() > 0) { successMsg.setText(sampler.getSuccess()); } else { successMsg.setText(JMeterUtils.getResString("junit_success_default_msg")); //$NON-NLS-1$ } if (sampler.getFailureCode().length() > 0) { failureCode.setText(sampler.getFailureCode()); } else { failureCode.setText(JMeterUtils.getResString("junit_failure_default_code")); //$NON-NLS-1$ } if (sampler.getFailure().length() > 0) { failureMsg.setText(sampler.getFailure()); } else { failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg")); //$NON-NLS-1$ } if (sampler.getError().length() > 0) { errorMsg.setText(sampler.getError()); } else { errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg")); //$NON-NLS-1$ }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java File path: /jakarta-jmeter-2.3.2/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java
Method name: void configure(TestElement) Method name: void configure(TestElement)
Number of AST nodes: 15 Number of AST nodes: 15
1
if (sampler.getSuccessCode().length() > 0) {
2
            successCode.setText(sampler.getSuccessCode());
3
        } else {
4
            successCode.setText(JMeterUtils.getResString("junit_success_default_code")); //$NON-NLS-1$
5
        }
1
if (sampler.getSuccess().length() > 0) {
6
        if (sampler.getSuccess().length() > 0) {
2
            successMsg.setText(sampler.getSuccess());
7
            successMsg.setText(sampler.getSuccess());
3
        } else {
8
        } else {
4
            successMsg.setText(JMeterUtils.getResString("junit_success_default_msg")); //$NON-NLS-1$
9
            successMsg.setText(JMeterUtils.getResString("junit_success_default_msg")); //$NON-NLS-1$
5
        }
10
        }
6
        if (sampler.getFailureCode().length() > 0) {
11
        if (sampler.getFailureCode().length() > 0) {
7
            failureCode.setText(sampler.getFailureCode());
12
            failureCode.setText(sampler.getFailureCode());
8
        } else {
13
        } else {
9
            failureCode.setText(JMeterUtils.getResString("junit_failure_default_code")); //$NON-NLS-1$
14
            failureCode.setText(JMeterUtils.getResString("junit_failure_default_code")); //$NON-NLS-1$
10
        }
15
        }
11
        if (sampler.getFailure().length() > 0) {
16
        if (sampler.getFailure().length() > 0) {
12
            failureMsg.setText(sampler.getFailure());
17
            failureMsg.setText(sampler.getFailure());
13
        } else {
18
        } else {
14
            failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg")); //$NON-NLS-1$
19
            failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg")); //$NON-NLS-1$
15
        }
20
        }
16
        if (sampler.getError().length() > 0) {
21
        if (sampler.getError().length() > 0) {
17
            errorMsg.setText(sampler.getError());
22
            errorMsg.setText(sampler.getError());
18
        } else {
23
        } else {
19
            errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg")); //$NON-NLS-1$
24
            errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg")); //$NON-NLS-1$
20
        }
25
        }
21
        if (sampler.getErrorCode().length() > 0) {
22
            errorCode.setText(sampler.getErrorCode());
23
        } else {
24
            errorCode.setText(JMeterUtils.getResString("junit_error_default_code")); //$NON-NLS-1$
25
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)3.3
Clones locationClones are in the same method
Number of node comparisons145
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)9.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    if (sampler.getSuccess().length() > 0)
    11
    if (sampler.getSuccess().length() > 0)
    12
    successMsg.setText(sampler.getSuccess());
    12
    successMsg.setText(sampler.getSuccess());
    else
    else
    13
    successMsg.setText(JMeterUtils.getResString("junit_success_default_msg"));
    13
    successMsg.setText(JMeterUtils.getResString("junit_success_default_msg"));
    14
    if (sampler.getFailureCode().length() > 0)
    14
    if (sampler.getFailureCode().length() > 0)
    15
    failureCode.setText(sampler.getFailureCode());
    15
    failureCode.setText(sampler.getFailureCode());
    else
    else
    16
    failureCode.setText(JMeterUtils.getResString("junit_failure_default_code"));
    16
    failureCode.setText(JMeterUtils.getResString("junit_failure_default_code"));
    17
    if (sampler.getFailure().length() > 0)
    17
    if (sampler.getFailure().length() > 0)
    18
    failureMsg.setText(sampler.getFailure());
    18
    failureMsg.setText(sampler.getFailure());
    else
    else
    19
    failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg"));
    19
    failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg"));
    20
    if (sampler.getError().length() > 0)
    20
    if (sampler.getError().length() > 0)
    21
    errorMsg.setText(sampler.getError());
    21
    errorMsg.setText(sampler.getError());
    else
    else
    22
    errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg"));
    22
    errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg"));
    23
    if (sampler.getErrorCode().length() > 0)
    23
    if (sampler.getErrorCode().length() > 0)
    8
    if (sampler.getSuccessCode().length() > 0)
    Differences
    Expression1Expression2Difference
    getErrorCodegetSuccessCodeMETHOD_INVOCATION_NAME_MISMATCH
    8
    if (sampler.getSuccessCode().length() > 0)
    24
    errorCode.setText(sampler.getErrorCode());
    24
    errorCode.setText(sampler.getErrorCode());
    9
    successCode.setText(sampler.getSuccessCode());
    Differences
    Expression1Expression2Difference
    getErrorCodegetSuccessCodeMETHOD_INVOCATION_NAME_MISMATCH
    errorCodesuccessCodeVARIABLE_NAME_MISMATCH
    9
    successCode.setText(sampler.getSuccessCode());
    else
    else
    25
    errorCode.setText(JMeterUtils.getResString("junit_error_default_code"));
    25
    errorCode.setText(JMeterUtils.getResString("junit_error_default_code"));
    10
    successCode.setText(JMeterUtils.getResString("junit_success_default_code"));
    Differences
    Expression1Expression2Difference
    "junit_error_default_code""junit_success_default_code"LITERAL_VALUE_MISMATCH
    errorCodesuccessCodeVARIABLE_NAME_MISMATCH
    10
    successCode.setText(JMeterUtils.getResString("junit_success_default_code"));
    Precondition Violations (0)
    Row Violation