typeEditor.setAsText(text); // may throw IllegalArgumentException value = typeEditor.getAsText(); if (!acceptsOther && !isATag(text)) { throw new IllegalArgumentException("Value not allowed: "+text); }
typeEditor.setValue(value); // may throw IllegalArgumentExc. text = fixGetAsTextBug(typeEditor.getAsText()); if (!acceptsOther && !isATag(text)) { throw new IllegalArgumentException("Value not allowed: "+text); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testbeans/gui/WrapperEditor.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testbeans/gui/WrapperEditor.java
Method name: void setAsText(String) Method name: void setValue(Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
typeEditor.setAsText(text); // may throw IllegalArgumentException
1
typeEditor.setValue(value); // may throw IllegalArgumentExc
2
				value = 
2
.
3
typeEditor.getAsText();
3
			text = fixGetAsTextBug(typeEditor.getAsText());
4
				if (!acceptsOther && !isATag(text)) {
4
			if (!acceptsOther && !isATag(text)) {
5
					throw new IllegalArgumentException("Value not allowed: "+text);
5
				throw new IllegalArgumentException("Value not allowed: "+text);
6
				}
6
			}
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)0.3
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)8.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                  
    10
    typeEditor.setValue(value);
    10
    typeEditor.setAsText(text);
                                                                  
    11
    value = typeEditor.getAsText();
    11
    value = typeEditor.getAsText();
    11
    text = fixGetAsTextBug(typeEditor.getAsText());
    Differences
    Expression1Expression2Difference
    valuetextVARIABLE_NAME_MISMATCH
    getAsTextfixGetAsTextBugMETHOD_INVOCATION_NAME_MISMATCH
    typeEditor.getAsText()fixGetAsTextBug(typeEditor.getAsText())ARGUMENT_NUMBER_MISMATCH
    typeEditorMISSING_METHOD_INVOCATION_EXPRESSION
    11
    text = fixGetAsTextBug(typeEditor.getAsText());
    12
    if (!acceptsOther && !isATag(text))
    12
    if (!acceptsOther && !isATag(text))
    13
    throw new IllegalArgumentException("Value not allowed: " + text);
    13
    throw new IllegalArgumentException("Value not allowed: " + text);
    Precondition Violations (0)
    Row Violation