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 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 8.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 10 | typeEditor.setValue(value); |
10 | typeEditor.setAsText(text); | | | |
11 | value = typeEditor.getAsText(); | | 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 |