Number result = null;
BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(row,
column);
if (item != null) {
result = item.getMean();
}
return result;
Number result = null;
BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(row,
column);
if (item != null) {
result = item.getMedian();
}
return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/DefaultBoxAndWhiskerCategoryDataset.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/DefaultBoxAndWhiskerCategoryDataset.java
|
Method name: Number getMeanValue(int, int)
|
|
Method name: Number getMedianValue(int, int)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | Number result = null;↵ | | 1 | Number result = null;↵
|
2 | BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(row, ↵ | | 2 | BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(row, ↵
|
3 | column);↵ | | 3 | column);↵
|
4 | if (item != null) {↵ | | 4 | if (item != null) {↵
|
5 | result = item.getMean();↵ | | 5 | result = item.getMedian();↵
|
6 | }↵ | | 6 | }↵
|
7 | return result; | | 7 | 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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
-
{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) | 4.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Number result = null; | | 1 | Number result = null; |
2 | BoxAndWhiskerItem item = (BoxAndWhiskerItem)this.data.getObject(row, column); | | 2 | BoxAndWhiskerItem item = (BoxAndWhiskerItem)this.data.getObject(row, column); |
3 | if (item != null) | | 3 | if (item != null) |
4 | | | 4 | result = item.getMedian(); |
5 | return result; | | 5 | return result; |
Precondition Violations (2)
Row |
Violation |
1 | Expression item.getMean() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression item.getMedian() cannot be parameterized, because it has dependencies to/from statements that will be extracted |