if ((percent < 0.0) || (percent > MAX_INTERIOR_GAP)) {
throw new IllegalArgumentException(
"Invalid 'percent' (" + percent + ") argument.");
}
if (this.interiorGap != percent) {
this.interiorGap = percent;
fireChangeEvent();
}
if ((percent < 0.0) || (percent > MAX_INTERIOR_GAP)) {
throw new IllegalArgumentException(
"Percentage outside valid range.");
}
if (this.interiorGap != percent) {
this.interiorGap = percent;
fireChangeEvent();
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/SpiderWebPlot.java
|
Method name: void setInteriorGap(double)
|
|
Method name: void setInteriorGap(double)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if ((percent < 0.0) || (percent > MAX_INTERIOR_GAP)) {↵ | | 1 | if ((percent < 0.0) || (percent > MAX_INTERIOR_GAP)) {↵
|
2 | throw new IllegalArgumentException(↵ | | 2 | throw new IllegalArgumentException(↵
|
3 | "Invalid 'percent' (" + percent + ") argument.");↵ | | 3 | "Percentage outside valid range.");↵
|
4 | }↵ | | 4 | }↵
|
|
5 | if (this.interiorGap != percent) {↵ | | 5 | if (this.interiorGap != percent) {↵
|
6 | this.interiorGap = percent;↵ | | 6 | this.interiorGap = percent;↵
|
7 | fireChangeEvent();↵ | | 7 | fireChangeEvent();↵
|
8 | } | | 8 | }
|
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.8 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 15 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 17.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if ((percent < 0.0) || (percent > MAX_INTERIOR_GAP)) | | 1 | if ((percent < 0.0) || (percent > MAX_INTERIOR_GAP)) |
2 | throw new IllegalArgumentException("Invalid 'percent' (" + percent + ") argument."); | | 2 | throw new IllegalArgumentException("Percentage outside valid range."); |
3 | if (this.interiorGap != percent) | | 3 | if (this.interiorGap != percent) |
4 | this.interiorGap = percent; | | 4 | this.interiorGap = percent; |
5 | | | 5 | |
Precondition Violations (1)
Row |
Violation |
1 | Expression "Invalid 'percent' (" + percent + ") argument." cannot be parameterized, because it has dependencies to/from statements that will be extracted |