double[] result = new double[2];
if (stack1[0] == 0.0 || stack2[0] == 0.0) {
result[0] = 0.0;
}
else {
result[0] = (stack1[0] + stack2[0]) / 2.0;
}
if (stack1[1] == 0.0 || stack2[1] == 0.0) {
result[1] = 0.0;
}
else {
result[1] = (stack1[1] + stack2[1]) / 2.0;
}
return result;
double[] result = new double[2];
if (stack1[0] == 0.0 || stack2[0] == 0.0) {
result[0] = 0.0;
}
else {
result[0] = (stack1[0] + stack2[0]) / 2.0;
}
if (stack1[1] == 0.0 || stack2[1] == 0.0) {
result[1] = 0.0;
}
else {
result[1] = (stack1[1] + stack2[1]) / 2.0;
}
return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StackedAreaRenderer.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java
|
Method name: double[] adjustedStackValues(double[], double[])
|
|
Method name: double[] adjustedStackValues(double[], double[])
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | double[] result = new double[2];↵ | | 1 | double[] result = new double[2];↵
|
2 | if (stack1[0] == 0.0 || stack2[0] == 0.0) {↵ | | 2 | if (stack1[0] == 0.0 || stack2[0] == 0.0) {↵
|
3 | result[0] = 0.0;↵ | | 3 | result[0] = 0.0;↵
|
4 | }↵ | | 4 | }↵
|
5 | else {↵ | | 5 | else {↵
|
6 | result[0] = (stack1[0] + stack2[0]) / 2.0;↵ | | 6 | result[0] = (stack1[0] + stack2[0]) / 2.0;↵
|
7 | }↵ | | 7 | }↵
|
8 | if (stack1[1] == 0.0 || stack2[1] == 0.0) {↵ | | 8 | if (stack1[1] == 0.0 || stack2[1] == 0.0) {↵
|
9 | result[1] = 0.0;↵ | | 9 | result[1] = 0.0;↵
|
10 | }↵ | | 10 | }↵
|
11 | else {↵ | | 11 | else {↵
|
12 | result[1] = (stack1[1] + stack2[1]) / 2.0;↵ | | 12 | result[1] = (stack1[1] + stack2[1]) / 2.0;↵
|
13 | }↵ | | 13 | }↵
|
14 | return result; | | 14 | return result;
|
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.6 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 32 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 2.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | double[] result = new double[2]; | | 1 | double[] result = new double[2]; |
2 | if (stack1[0] == 0.0 || stack2[0] == 0.0) | | 2 | if (stack1[0] == 0.0 || stack2[0] == 0.0) |
3 | | | 3 | |
| | | | |
4 | result[0] = (stack1[0] + stack2[0]) / 2.0; | | 4 | result[0] = (stack1[0] + stack2[0]) / 2.0; |
5 | if (stack1[1] == 0.0 || stack2[1] == 0.0) | | 5 | if (stack1[1] == 0.0 || stack2[1] == 0.0) |
6 | | | 6 | |
| | | | |
7 | result[1] = (stack1[1] + stack2[1]) / 2.0; | | 7 | result[1] = (stack1[1] + stack2[1]) / 2.0; |
8 | return result; | | 8 | return result; |
Precondition Violations (0)
Row |
Violation |