File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AbstractRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AbstractRenderer.java | |||
Method name: Paint lookupSeriesPaint(int)
|
Method name: Shape lookupSeriesShape(int)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | if (this.paint != null) {↵ | 1 | if (this.shape != null) {↵ | |
2 | return this.paint;↵ | 2 | return this.shape;↵ | |
3 | }↵ | 3 | }↵ | |
4 | // otherwise look up the paint list↵ | 4 | // otherwise look up the shape list↵ | |
5 | Paint seriesPaint = getSeriesPaint(series);↵ | 5 | Shape result = getSeriesShape(series);↵ | |
6 | if (seriesPaint == null && this.autoPopulateSeriesPaint) {↵ | 6 | if (result == null && this.autoPopulateSeriesShape) {↵ | |
7 | DrawingSupplier supplier = getDrawingSupplier();↵ | 7 | DrawingSupplier supplier = getDrawingSupplier();↵ | |
8 | if (supplier != null) {↵ | 8 | if (supplier != null) {↵ | |
9 | seriesPaint = supplier.getNextPaint();↵ | 9 | result = supplier.getNextShape();↵ | |
10 | setSeriesPaint(series, seriesPaint, false);↵ | 10 | setSeriesShape(series, result, false);↵ | |
11 | }↵ | 11 | }↵ | |
12 | }↵ | 12 | }↵ | |
13 | if (seriesPaint == null) {↵ | 13 | if (result == null) {↵ | |
14 | seriesPaint = this.basePaint;↵ | 14 | result = this.baseShape;↵ | |
15 | }↵ | 15 | }↵ | |
16 | return seriesPaint; | 16 | return result; | |
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 27 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 6 |
Number of unmapped statements in the second code fragment | 6 |
Time elapsed for statement mapping (ms) | 3.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (this.paint != null) |
| 1 | if (this.shape != null) | |||||||||||||||||
|
| 2 | return this.shape; | ||||||||||||||||||
2 | return this.paint; |
| | ||||||||||||||||||
| 3 | Shape result = getSeriesShape(series); | |||||||||||||||||||
3 | Paint seriesPaint = getSeriesPaint(series); | | |||||||||||||||||||
4 | if (seriesPaint == null && this.autoPopulateSeriesPaint) |
| 4 | if (result == null && this.autoPopulateSeriesShape) | |||||||||||||||||
5 | DrawingSupplier supplier = getDrawingSupplier(); | 5 | DrawingSupplier supplier = getDrawingSupplier(); | ||||||||||||||||||
6 | if (supplier != null) | 6 | if (supplier != null) | ||||||||||||||||||
|
| 7 | result = supplier.getNextShape(); | ||||||||||||||||||
7 | seriesPaint = supplier.getNextPaint(); |
| | ||||||||||||||||||
|
| 8 | setSeriesShape(series, result, false); | ||||||||||||||||||
8 | setSeriesPaint(series, seriesPaint, false); |
| | ||||||||||||||||||
9 | if (seriesPaint == null) |
| 9 | if (result == null) | |||||||||||||||||
|
| 10 | result = this.baseShape; | ||||||||||||||||||
10 | seriesPaint = this.basePaint; |
| | ||||||||||||||||||
|
| 11 | return result; | ||||||||||||||||||
11 | return seriesPaint; |
| |
Row | Violation |
---|---|
1 | Type java.awt.Paint of variable this.paint does not match with type java.awt.Shape of variable this.shape |
2 | Unmatched statement return this.shape; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched return this.shape; |
4 | Unmatched statement return this.paint; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched return this.paint; |
6 | Type java.awt.Paint of variable seriesPaint does not match with type java.awt.Shape of variable result |
7 | Unmatched statement result=supplier.getNextShape(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement seriesPaint=supplier.getNextPaint(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement setSeriesShape(series,result,false); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
10 | Unmatched statement setSeriesPaint(series,seriesPaint,false); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
11 | Type java.awt.Paint of variable seriesPaint does not match with type java.awt.Shape of variable result |
12 | Unmatched statement result=this.baseShape; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
13 | Unmatched statement seriesPaint=this.basePaint; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
14 | Unmatched return result; |
15 | Unmatched return seriesPaint; |