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$ } if (sampler.getErrorCode().length() > 0) { errorCode.setText(sampler.getErrorCode()); } else { errorCode.setText(JMeterUtils.getResString("junit_error_default_code")); //$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: 9 Number of AST nodes: 9
1
if (sampler.getSuccessCode().length() > 0) {
1
if (sampler.getFailure().length() > 0) {
2
            successCode.setText(sampler.getSuccessCode());
2
            failureMsg.setText(sampler.getFailure());
3
        } else {
3
        } else {
4
            successCode.setText(JMeterUtils.getResString("junit_success_default_code")); //$NON-NLS-1$
4
            failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg")); //$NON-NLS-1$
5
        }
5
        }
6
        if (sampler.getSuccess().length() > 0) {
6
        if (sampler.getError().length() > 0) {
7
            successMsg.setText(sampler.getSuccess());
7
            errorMsg.setText(sampler.getError());
8
        } else {
8
        } else {
9
            successMsg.setText(JMeterUtils.getResString("junit_success_default_msg")); //$NON-NLS-1$
9
            errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg")); //$NON-NLS-1$
10
        }
10
        }
11
        if (sampler.getFailureCode().length() > 0) {
11
        if (sampler.getErrorCode().length() > 0) {
12
            failureCode.setText(sampler.getFailureCode());
12
            errorCode.setText(sampler.getErrorCode());
13
        } else {
13
        } else {
14
            failureCode.setText(JMeterUtils.getResString("junit_failure_default_code")); //$NON-NLS-1$
14
            errorCode.setText(JMeterUtils.getResString("junit_error_default_code")); //$NON-NLS-1$
15
        }
15
        }
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)1.1
Clones locationClones are in the same method
Number of node comparisons57
  1. {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)19.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    if (sampler.getSuccessCode().length() > 0)
    8
    if (sampler.getSuccessCode().length() > 0)
    23
    if (sampler.getErrorCode().length() > 0)
    Differences
    Expression1Expression2Difference
    getSuccessCodegetErrorCodeMETHOD_INVOCATION_NAME_MISMATCH
    23
    if (sampler.getErrorCode().length() > 0)
    9
    successCode.setText(sampler.getSuccessCode());
    9
    successCode.setText(sampler.getSuccessCode());
    24
    errorCode.setText(sampler.getErrorCode());
    Differences
    Expression1Expression2Difference
    getSuccessCodegetErrorCodeMETHOD_INVOCATION_NAME_MISMATCH
    successCodeerrorCodeVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression sampler.getSuccessCode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.getErrorCode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24
    errorCode.setText(sampler.getErrorCode());
    else
    else
    10
    successCode.setText(JMeterUtils.getResString("junit_success_default_code"));
    10
    successCode.setText(JMeterUtils.getResString("junit_success_default_code"));
    25
    errorCode.setText(JMeterUtils.getResString("junit_error_default_code"));
    Differences
    Expression1Expression2Difference
    "junit_success_default_code""junit_error_default_code"LITERAL_VALUE_MISMATCH
    successCodeerrorCodeVARIABLE_NAME_MISMATCH
    25
    errorCode.setText(JMeterUtils.getResString("junit_error_default_code"));
    11
    if (sampler.getSuccess().length() > 0)
    11
    if (sampler.getSuccess().length() > 0)
    20
    if (sampler.getError().length() > 0)
    Differences
    Expression1Expression2Difference
    getSuccessgetErrorMETHOD_INVOCATION_NAME_MISMATCH
    20
    if (sampler.getError().length() > 0)
    12
    successMsg.setText(sampler.getSuccess());
    12
    successMsg.setText(sampler.getSuccess());
    21
    errorMsg.setText(sampler.getError());
    Differences
    Expression1Expression2Difference
    getSuccessgetErrorMETHOD_INVOCATION_NAME_MISMATCH
    successMsgerrorMsgVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression sampler.getSuccess() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.getError() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21
    errorMsg.setText(sampler.getError());
    else
            
    13
    successMsg.setText(JMeterUtils.getResString("junit_success_default_msg"));
    13
    successMsg.setText(JMeterUtils.getResString("junit_success_default_msg"));
    Preondition Violations
    Unmatched statement successMsg.setText(JMeterUtils.getResString("junit_success_default_msg")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                
                                                                                                                                                        
    22
    errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg"));
    Preondition Violations
    Unmatched statement errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    22
    errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg"));
    14
    if (sampler.getFailureCode().length() > 0)
    14
    if (sampler.getFailureCode().length() > 0)
    17
    if (sampler.getFailure().length() > 0)
    Differences
    Expression1Expression2Difference
    getFailureCodegetFailureMETHOD_INVOCATION_NAME_MISMATCH
    17
    if (sampler.getFailure().length() > 0)
    15
    failureCode.setText(sampler.getFailureCode());
    15
    failureCode.setText(sampler.getFailureCode());
    18
    failureMsg.setText(sampler.getFailure());
    Differences
    Expression1Expression2Difference
    getFailureCodegetFailureMETHOD_INVOCATION_NAME_MISMATCH
    failureCodefailureMsgVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression sampler.getFailureCode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sampler.getFailure() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18
    failureMsg.setText(sampler.getFailure());
    else
            
    16
    failureCode.setText(JMeterUtils.getResString("junit_failure_default_code"));
    16
    failureCode.setText(JMeterUtils.getResString("junit_failure_default_code"));
    Preondition Violations
    Unmatched statement failureCode.setText(JMeterUtils.getResString("junit_failure_default_code")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                    
                                                                                                                                                                
    19
    failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg"));
    Preondition Violations
    Unmatched statement failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    19
    failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg"));
    Precondition Violations (10)
    Row Violation
    1Expression sampler.getSuccessCode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression sampler.getErrorCode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression sampler.getSuccess() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression sampler.getError() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement successMsg.setText(JMeterUtils.getResString("junit_success_default_msg")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement errorMsg.setText(JMeterUtils.getResString("junit_error_default_msg")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Expression sampler.getFailureCode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression sampler.getFailure() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Unmatched statement failureCode.setText(JMeterUtils.getResString("junit_failure_default_code")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10Unmatched statement failureMsg.setText(JMeterUtils.getResString("junit_failure_default_msg")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted