File path: /jfreechart-1.0.10/src/org/jfree/chart/title/TextTitle.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/title/TextTitle.java | |||
Method name: void drawHorizontal(Graphics2D, Rectangle2D)
|
Method name: void drawVertical(Graphics2D, Rectangle2D)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | if (position == RectangleEdge.TOP) {↵ | 1 | if (position == RectangleEdge.LEFT) {↵ | |
2 | y = (float) titleArea.getY();↵ | 2 | x = (float) titleArea.getX();↵ | |
3 | }↵ | 3 | }↵ | |
4 | else if (position == RectangleEdge.BOTTOM) {↵ | 4 | else if (position == RectangleEdge.RIGHT) {↵ | |
5 | y = (float) titleArea.getMaxY();↵ | 5 | x = (float) titleArea.getMaxX();↵ | |
6 | if (horizontalAlignment == HorizontalAlignment.LEFT) {↵ | 6 | if (verticalAlignment == VerticalAlignment.TOP) {↵ | |
7 | anchor = TextBlockAnchor.BOTTOM_LEFT;↵ | 7 | anchor = TextBlockAnchor.BOTTOM_RIGHT;↵ | |
8 | }↵ | 8 | }↵ | |
9 | else if (horizontalAlignment == HorizontalAlignment.CENTER) {↵ | 9 | else if (verticalAlignment == VerticalAlignment.CENTER) {↵ | |
10 | anchor = TextBlockAnchor.BOTTOM_CENTER;↵ | 10 | anchor = TextBlockAnchor.BOTTOM_CENTER;↵ | |
11 | }↵ | 11 | }↵ | |
12 | else if (horizontalAlignment == HorizontalAlignment.RIGHT) {↵ | 12 | else if (verticalAlignment == VerticalAlignment.BOTTOM) {↵ | |
13 | anchor = TextBlockAnchor.BOTTOM_RIGHT;↵ | 13 | anchor = TextBlockAnchor.BOTTOM_LEFT;↵ | |
14 | }↵ | 14 | }↵ | |
15 | } | 15 |
| |
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) | 1.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 35 |
Number of mapped statements | 10 |
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.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18 | if (position == RectangleEdge.TOP) |
| 18 | if (position == RectangleEdge.LEFT) | |||||||||||||||||||||||||
19 | y = (float)titleArea.getY(); |
| 19 | x = (float)titleArea.getX(); | |||||||||||||||||||||||||
20 | else if (position == RectangleEdge.BOTTOM) |
| 20 | else if (position == RectangleEdge.RIGHT) | |||||||||||||||||||||||||
21 | y = (float)titleArea.getMaxY(); |
| 21 | x = (float)titleArea.getMaxX(); | |||||||||||||||||||||||||
22 | if (horizontalAlignment == HorizontalAlignment.LEFT) |
| 26 | if (verticalAlignment == VerticalAlignment.BOTTOM) | |||||||||||||||||||||||||
23 | anchor = TextBlockAnchor.BOTTOM_LEFT; | 27 | anchor = TextBlockAnchor.BOTTOM_LEFT; | ||||||||||||||||||||||||||
24 | else if (horizontalAlignment == HorizontalAlignment.CENTER) |
| 24 | else if (verticalAlignment == VerticalAlignment.CENTER) | |||||||||||||||||||||||||
25 | anchor = TextBlockAnchor.BOTTOM_CENTER; | 25 | anchor = TextBlockAnchor.BOTTOM_CENTER; | ||||||||||||||||||||||||||
26 | else if (horizontalAlignment == HorizontalAlignment.RIGHT) |
| 22 | else if (verticalAlignment == VerticalAlignment.TOP) | |||||||||||||||||||||||||
27 | anchor = TextBlockAnchor.BOTTOM_RIGHT; | 23 | anchor = TextBlockAnchor.BOTTOM_RIGHT; |
Row | Violation |
---|---|
1 | Type org.jfree.ui.HorizontalAlignment of variable horizontalAlignment does not match with type org.jfree.ui.VerticalAlignment of variable verticalAlignment |
2 | Type org.jfree.ui.HorizontalAlignment does not match with type org.jfree.ui.VerticalAlignment |
3 | Type org.jfree.ui.HorizontalAlignment of variable HorizontalAlignment.LEFT does not match with type org.jfree.ui.VerticalAlignment of variable VerticalAlignment.BOTTOM |
4 | Type org.jfree.ui.HorizontalAlignment of variable horizontalAlignment does not match with type org.jfree.ui.VerticalAlignment of variable verticalAlignment |
5 | Type org.jfree.ui.HorizontalAlignment does not match with type org.jfree.ui.VerticalAlignment |
6 | Type org.jfree.ui.HorizontalAlignment of variable HorizontalAlignment.CENTER does not match with type org.jfree.ui.VerticalAlignment of variable VerticalAlignment.CENTER |
7 | Type org.jfree.ui.HorizontalAlignment of variable horizontalAlignment does not match with type org.jfree.ui.VerticalAlignment of variable verticalAlignment |
8 | Type org.jfree.ui.HorizontalAlignment does not match with type org.jfree.ui.VerticalAlignment |
9 | Type org.jfree.ui.HorizontalAlignment of variable HorizontalAlignment.RIGHT does not match with type org.jfree.ui.VerticalAlignment of variable VerticalAlignment.TOP |
10 | Clone fragment #1 returns variables y, anchor , while Clone fragment #2 returns variables x, anchor |