if (noUndefined == b) { return; } noUndefined = b; if (noUndefined) { model.removeElement(UNDEFINED); } else { model.insertElementAt(UNDEFINED, 0); }
if (noEdit == b) { return; } noEdit = b; if (noEdit) { model.removeElement(EDIT); } else { model.addElement(EDIT); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testbeans/gui/ComboStringEditor.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testbeans/gui/ComboStringEditor.java
Method name: void setNoUndefined(boolean) Method name: void setNoEdit(boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (noUndefined == b) {
1
if (noEdit == b) {
2
			return;
2
			return;
3
		}
3
		}
4
		noUndefined = b;
4
		noEdit = b;
5
		if (noUndefined) {
5
		if (noEdit) {
6
			model.removeElement(UNDEFINED);
6
			model.removeElement(EDIT);
7
		} else {
7
		} else {
8
			model.insertElementAt(UNDEFINED, 0);
8
			model.addElement(EDIT);
9
		}
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.2
Clones locationClones are declared in the same class
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (noUndefined == b)
    1
    if (noUndefined == b)
    1
    if (noEdit == b)
    Differences
    Expression1Expression2Difference
    noUndefinednoEditVARIABLE_NAME_MISMATCH
    1
    if (noEdit == b)
    2
    return;
    2
    return;
    3
    noUndefined = b;
    3
    noUndefined = b;
    3
    noEdit = b;
    Differences
    Expression1Expression2Difference
    noUndefinednoEditVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression noUndefined is a field being modified, and thus it cannot be parameterized
    Expression noEdit is a field being modified, and thus it cannot be parameterized
    3
    noEdit = b;
    4
    if (noUndefined)
    4
    if (noUndefined)
    4
    if (noEdit)
    Differences
    Expression1Expression2Difference
    noUndefinednoEditVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression noUndefined cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression noEdit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    if (noEdit)
    5
    model.removeElement(UNDEFINED);
    5
    model.removeElement(UNDEFINED);
    5
    model.removeElement(EDIT);
    Differences
    Expression1Expression2Difference
    UNDEFINEDEDITVARIABLE_NAME_MISMATCH
    5
    model.removeElement(EDIT);
    else
    else
    6
    model.insertElementAt(UNDEFINED, 0);
    6
    model.insertElementAt(UNDEFINED, 0);
    6
    model.addElement(EDIT);
    Differences
    Expression1Expression2Difference
    insertElementAtaddElementMETHOD_INVOCATION_NAME_MISMATCH
    model.insertElementAt(UNDEFINED,0)model.addElement(EDIT)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression model.insertElementAt(UNDEFINED,0) is a void method call, and thus it cannot be parameterized
    Expression model.addElement(EDIT) is a void method call, and thus it cannot be parameterized
    Expression model.insertElementAt(UNDEFINED,0) is a void method call, and thus it cannot be parameterized
    Expression model.addElement(EDIT) is a void method call, and thus it cannot be parameterized
    6
    model.addElement(EDIT);
    Precondition Violations (8)
    Row Violation
    1Expression noUndefined is a field being modified, and thus it cannot be parameterized
    2Expression noEdit is a field being modified, and thus it cannot be parameterized
    3Expression noUndefined cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression noEdit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression model.insertElementAt(UNDEFINED,0) is a void method call, and thus it cannot be parameterized
    6Expression model.addElement(EDIT) is a void method call, and thus it cannot be parameterized
    7Expression model.insertElementAt(UNDEFINED,0) is a void method call, and thus it cannot be parameterized
    8Expression model.addElement(EDIT) is a void method call, and thus it cannot be parameterized