if (position == RectangleEdge.BOTTOM) { y = (float) titleArea.getMaxY(); if (horizontalAlignment == HorizontalAlignment.LEFT) { anchor = TextBlockAnchor.BOTTOM_LEFT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } }
if (position == RectangleEdge.RIGHT) { x = (float) titleArea.getMaxX(); if (verticalAlignment == VerticalAlignment.TOP) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } else if (verticalAlignment == VerticalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { anchor = TextBlockAnchor.BOTTOM_LEFT; } }
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: 8 Number of AST nodes: 8
1
if (position == RectangleEdge.BOTTOM) {
1
if (position == RectangleEdge.RIGHT) {
2
            y = (float) titleArea.getMaxY();
2
            x = (float) titleArea.getMaxX();
3
            if (horizontalAlignment == HorizontalAlignment.LEFT) {
3
            if (verticalAlignment == VerticalAlignment.TOP) {
4
                anchor = TextBlockAnchor.BOTTOM_LEFT;
4
                anchor = TextBlockAnchor.BOTTOM_RIGHT;
5
            }
5
            }
6
            else if (horizontalAlignment == HorizontalAlignment.CENTER) {
6
            else if (verticalAlignment == VerticalAlignment.CENTER) {
7
                anchor = TextBlockAnchor.BOTTOM_CENTER;
7
                anchor = TextBlockAnchor.BOTTOM_CENTER;
8
            }
8
            }
9
            else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
9
            else if (verticalAlignment == VerticalAlignment.BOTTOM) {
10
                anchor = TextBlockAnchor.BOTTOM_RIGHT;
10
                anchor = TextBlockAnchor.BOTTOM_LEFT;
11
            }
11
            }
12
        }
12
        }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.7
Clones locationClones are declared in the same class
Number of node comparisons9