File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java | |||
Method name: Paint lookupSectionPaint(Comparable, boolean)
|
Method name: Stroke lookupSectionOutlineStroke(Comparable, boolean)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | Paint result = getSectionPaint();↵ | 1 | Stroke result = getSectionOutlineStroke();↵ | |
2 | if (result != null) {↵ | 2 | if (result != null) {↵ | |
3 | return result;↵ | 3 | return result;↵ | |
4 | }↵ | 4 | }↵ | |
5 | ↵ | 5 | ↵ | |
6 | // if not, check if there is a paint defined for the specified key↵ | 6 | // if not, check if there is a stroke defined for the specified key↵ | |
7 | result = this.sectionPaintMap.getPaint(key);↵ | 7 | result = this.sectionOutlineStrokeMap.getStroke(key);↵ | |
8 | if (result != null) {↵ | 8 | if (result != null) {↵ | |
9 | return result;↵ | 9 | return result;↵ | |
10 | }↵ | 10 | }↵ | |
11 | ↵ | 11 | ↵ | |
12 | // nothing defined - do we autoPopulate?↵ | 12 | // nothing defined - do we autoPopulate?↵ | |
13 | if (autoPopulate) {↵ | 13 | if (autoPopulate) {↵ | |
14 | DrawingSupplier ds = getDrawingSupplier();↵ | 14 | DrawingSupplier ds = getDrawingSupplier();↵ | |
15 | if (ds != null) {↵ | 15 | if (ds != null) {↵ | |
16 | result = ds.getNextPaint();↵ | 16 | result = ds.getNextOutlineStroke();↵ | |
17 | this.sectionPaintMap.put(key, result);↵ | 17 | this.sectionOutlineStrokeMap.put(key, result);↵ | |
18 | }↵ | 18 | }↵ | |
19 | else {↵ | 19 | else {↵ | |
20 | result = this.baseSectionPaint;↵ | 20 | result = this.baseSectionOutlineStroke;↵ | |
21 | }↵ | 21 | }↵ | |
22 | }↵ | 22 | }↵ | |
23 | else {↵ | 23 | else {↵ | |
24 | result = this.baseSectionPaint;↵ | 24 | result = this.baseSectionOutlineStroke;↵ | |
25 | }↵ | 25 | }↵ | |
26 | return result; | 26 |
| |
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 declared in the same class |
Number of node comparisons | 47 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 8 |
Number of unmapped statements in the second code fragment | 8 |
Time elapsed for statement mapping (ms) | 20.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Stroke result = getSectionOutlineStroke(); | ||||||||||||||||||||||
1 | Paint result = getSectionPaint(); | | ||||||||||||||||||||||
2 | if (result != null) |
| 2 | if (result != null) | ||||||||||||||||||||
|
| 3 | return result; | |||||||||||||||||||||
3 | return result; |
| | |||||||||||||||||||||
|
| 4 | result = this.sectionOutlineStrokeMap.getStroke(key); | |||||||||||||||||||||
4 | result = this.sectionPaintMap.getPaint(key); |
| | |||||||||||||||||||||
5 | if (result != null) |
| 5 | if (result != null) | ||||||||||||||||||||
|
| 6 | return result; | |||||||||||||||||||||
6 | return result; |
| | |||||||||||||||||||||
7 | if (autoPopulate) | 7 | if (autoPopulate) | |||||||||||||||||||||
8 | DrawingSupplier ds = getDrawingSupplier(); | 8 | DrawingSupplier ds = getDrawingSupplier(); | |||||||||||||||||||||
9 | if (ds != null) | 9 | if (ds != null) | |||||||||||||||||||||
|
| 10 | result = ds.getNextOutlineStroke(); | |||||||||||||||||||||
10 | result = ds.getNextPaint(); |
| | |||||||||||||||||||||
11 | this.sectionPaintMap.put(key, result); |
| 11 | this.sectionOutlineStrokeMap.put(key, result); | ||||||||||||||||||||
else | | |||||||||||||||||||||||
|
| 12 | result = this.baseSectionOutlineStroke; | |||||||||||||||||||||
12 | result = this.baseSectionPaint; |
| | |||||||||||||||||||||
else | | |||||||||||||||||||||||
|
| 13 | result = this.baseSectionOutlineStroke; | |||||||||||||||||||||
13 | result = this.baseSectionPaint; |
| | |||||||||||||||||||||
|
| 14 | return result; | |||||||||||||||||||||
14 | return result; |
| |
Row | Violation |
---|---|
1 | Type java.awt.Paint of variable result does not match with type java.awt.Stroke of variable result |
2 | Unmatched statement return result; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched return result; |
4 | Unmatched statement return result; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched return result; |
6 | Unmatched statement result=this.sectionOutlineStrokeMap.getStroke(key); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement result=this.sectionPaintMap.getPaint(key); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Type java.awt.Paint of variable result does not match with type java.awt.Stroke of variable result |
9 | Unmatched statement return result; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
10 | Unmatched return result; |
11 | Unmatched statement return result; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
12 | Unmatched return result; |
13 | Unmatched statement result=ds.getNextOutlineStroke(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
14 | Unmatched statement result=ds.getNextPaint(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
15 | Type java.awt.Paint of variable result does not match with type java.awt.Stroke of variable result |
16 | Expression this.sectionPaintMap cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression this.sectionOutlineStrokeMap cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Type org.jfree.chart.PaintMap of variable this.sectionPaintMap does not match with type org.jfree.chart.StrokeMap of variable this.sectionOutlineStrokeMap |
19 | Unmatched statement result=this.baseSectionOutlineStroke; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
20 | Unmatched statement result=this.baseSectionPaint; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
21 | Unmatched statement result=this.baseSectionOutlineStroke; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
22 | Unmatched statement result=this.baseSectionPaint; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
23 | Unmatched return result; |
24 | Unmatched return result; |