File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/HistogramDataset.java | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/XYIntervalSeriesCollection.java | |||
Method name: Object clone()
|
Method name: Object clone()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | HistogramDataset clone = (HistogramDataset↵ | 1 | XYIntervalSeriesCollection clone↵ | |
2 | ) super.clone();↵ | 2 | = (XYIntervalSeriesCollection) super.clone();↵ | |
3 | int seriesCount = getSeriesCount();↵ | 3 | int seriesCount = getSeriesCount();↵ | |
4 | clone.list = new java.util.ArrayList(seriesCount);↵ | 4 | clone.data = new java.util.ArrayList(seriesCount);↵ | |
5 | for (int i = 0; i < seriesCount; i++) {↵ | 5 | for (int i = 0; i < this.data.size(); i++) {↵ | |
6 | clone.list.add(new HashMap((Map) this.list.get(i)));↵ | 6 | clone.data.set(i, getSeries(i).clone());↵ | |
7 | }↵ | 7 | }↵ | |
8 | return clone; | 8 | return clone; | |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 12 |
Number of mapped statements | 5 |
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.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | HistogramDataset clone = (HistogramDataset)super.clone(); |
| 1 | XYIntervalSeriesCollection clone = (XYIntervalSeriesCollection)super.clone(); | ||||||||||||||||||
2 | int seriesCount = getSeriesCount(); | 2 | int seriesCount = getSeriesCount(); | |||||||||||||||||||
3 | clone.list = new java.util.ArrayList(seriesCount); |
| 3 | clone.data = new java.util.ArrayList(seriesCount); | ||||||||||||||||||
4 | for (int i = 0; i < seriesCount; i++) |
| 4 | for (int i = 0; i < this.data.size(); i++) | ||||||||||||||||||
|
| 5 | clone.data.set(i, getSeries(i).clone()); | |||||||||||||||||||
5 | clone.list.add(new HashMap((Map)this.list.get(i))); |
| | |||||||||||||||||||
6 | return clone; |
| 6 | return clone; |
Row | Violation |
---|---|
1 | Super method call HistogramDataset clone=(HistogramDataset)super.clone(); cannot be extracted from method |
2 | Super method call XYIntervalSeriesCollection clone=(XYIntervalSeriesCollection)super.clone(); cannot be extracted from method |
3 | Expression clone.list cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression clone.data cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression clone.list is a field being modified, and thus it cannot be parameterized |
6 | Expression clone.data is a field being modified, and thus it cannot be parameterized |
7 | Expression seriesCount cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement clone.data.set(i,getSeries(i).clone()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement clone.data.set(i,getSeries(i).clone()); 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 |
10 | Unmatched statement clone.list.add(new HashMap((Map)this.list.get(i))); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
11 | Clone fragment #1 returns variables clone, i , while Clone fragment #2 returns variables clone, i |