if (horizontalAlignment == HorizontalAlignment.CENTER) { startX = chartArea.getX() + leftSpace + chartArea.getWidth() / 2.0 - w / 2.0; } else if (horizontalAlignment == HorizontalAlignment.LEFT) { startX = chartArea.getX() + leftSpace; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { startX = chartArea.getX() + chartArea.getWidth() - rightSpace - w; }
if (alignment == VerticalAlignment.CENTER) { startY = chartArea.getMinY() + topSpace + chartArea.getHeight() / 2.0 - h / 2.0; } else if (alignment == VerticalAlignment.TOP) { startY = chartArea.getMinY() + topSpace; } else if (alignment == VerticalAlignment.BOTTOM) { startY = chartArea.getMaxY() - bottomSpace - h; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/title/ImageTitle.java File path: /jfreechart-1.0.10/src/org/jfree/chart/title/ImageTitle.java
Method name: Size2D drawHorizontal(Graphics2D, Rectangle2D) Method name: Size2D drawVertical(Graphics2D, Rectangle2D)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (horizontalAlignment == HorizontalAlignment.CENTER) {
1
if (alignment == VerticalAlignment.CENTER) {
2
            startX = chartArea.getX() + leftSpace
2
            startY = chartArea.getMinY() + topSpace
3
 + chartArea.getWidth() / 2.0
3
                     + chartArea.getHeight() / 2.0
4
                     - w / 2.0;
4
 - h / 2.0;
5
        }
5
        }
6
        else if (horizontalAlignment == HorizontalAlignment.LEFT) {
6
        else if (alignment == VerticalAlignment.TOP) {
7
            startX = chartArea.getX() + leftSpace;
7
            startY = chartArea.getMinY() + topSpace;
8
        }
8
        }
9
        else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
9
        else if (alignment == VerticalAlignment.BOTTOM) {
10
            startX = chartArea.getX() + chartArea.getWidth() - rightSpace - w;
10
            startY = chartArea.getMaxY() - bottomSpace - h;
11
        }
11
        }
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.8
Clones locationClones are declared in the same class
Number of node comparisons9