File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/StandardEntityCollection.java | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/DefaultTableXYDataset.java | |||
Method name: ChartEntity getEntity(double, double)
|
Method name: void updateXPoints(XYSeries)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | for (int i = entityCount - 1; i >= 0; i--) {↵ | 1 | for (int seriesNo = 0; seriesNo <↵ | |
2 | ChartEntity entity = (ChartEntity) this.entities.get(i);↵ | |||
2 | seriesCount; seriesNo++) {↵ | |||
3 | XYSeries dataSeries = (XYSeries) this.data.get(seriesNo);↵ | |||
3 | if (entity.getArea().contains(x, y)) {↵ | 4 | if (↵ | |
4 | return entity;↵ | |||
5 | }↵ | |||
5 | !dataSeries.equals(series)) {↵ | |||
6 | dataSeries.add(xValue, null);↵ | |||
7 | }↵ | |||
6 | } | 8 | } | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 6 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 14.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | ChartEntity entity = (ChartEntity)this.entities.get(i); |
| | |||||||||||||
|
| 13 | XYSeries dataSeries = (XYSeries)this.data.get(seriesNo); | |||||||||||||
4 | if (entity.getArea().contains(x, y)) |
| 14 | if (!dataSeries.equals(series)) | ||||||||||||
5 | return entity; |
| | |||||||||||||
|
| 15 | dataSeries.add(xValue, null); |
Row | Violation |
---|---|
1 | Unmatched statement ChartEntity entity=(ChartEntity)this.entities.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement XYSeries dataSeries=(XYSeries)this.data.get(seriesNo); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Expression entity.getArea().contains(x,y) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression !dataSeries.equals(series) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement return entity; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched return entity; |
7 | Unmatched statement dataSeries.add(xValue,null); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
8 | Unmatched statement dataSeries.add(xValue,null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
9 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |