1012-1-2

if (horizontalAlignment == HorizontalAlignment.LEFT) { x = (float) titleArea.getX(); anchor = TextBlockAnchor.TOP_LEFT; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { x = (float) titleArea.getMaxX(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { x = (float) titleArea.getCenterX(); anchor = TextBlockAnchor.TOP_CENTER; }
if (verticalAlignment == VerticalAlignment.TOP) { y = (float) titleArea.getY(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { y = (float) titleArea.getMaxY(); anchor = TextBlockAnchor.TOP_LEFT; } else if (verticalAlignment == VerticalAlignment.CENTER) { y = (float) titleArea.getCenterY(); anchor = TextBlockAnchor.TOP_CENTER; }

Clone fragments detected by clone detection tool
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: 9 |  | Number of AST nodes: 9

1

    if (horizontalAlignment == HorizontalAlignment.LEFT) {↵

1

    if (verticalAlignment == VerticalAlignment.TOP) {↵

2

                x = (float) titleArea.getX();↵

2

                y = (float) titleArea.getY();↵

3

                anchor = TextBlockAnchor.TOP_LEFT;↵

3

                anchor = TextBlockAnchor.TOP_RIGHT;↵

4

            }↵

4

            }↵

5

            else if (horizontalAlignment == HorizontalAlignment.RIGHT) {↵

5

            else if (verticalAlignment == VerticalAlignment.BOTTOM) {↵

6

                x = (float) titleArea.getMaxX();↵

6

                y = (float) titleArea.getMaxY();↵

7

                anchor = TextBlockAnchor.TOP_RIGHT;↵

7

                anchor = TextBlockAnchor.TOP_LEFT;↵

8

            }↵

8

            }↵

9

            else if (horizontalAlignment == HorizontalAlignment.CENTER) {↵

9

            else if (verticalAlignment == VerticalAlignment.CENTER) {↵

10

                x = (float) titleArea.getCenterX();↵

10

                y = (float) titleArea.getCenterY();↵

11

                anchor = TextBlockAnchor.TOP_CENTER;↵

11

                anchor = TextBlockAnchor.TOP_CENTER;↵

12

            }

12

            }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.7
Clones location | Clones are declared in the same class
Number of node comparisons | 9